diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-08-31 00:40:21 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-08-31 00:40:21 -0400 |
commit | 4eeacc60cab3d6cb070bcd19a5259b7a95832a1d (patch) | |
tree | 7e26aea1b95dec5bb5bfaf4749cba0b71dd06cf9 /src/components/IdleFunc.hpp | |
parent | 3a5718d4ab0d9f726686c601579a4c586a65e269 (diff) |
Lua spawned entities have "Idle" function
Every entity spawned from Lua is given the "Scripted" component,
this component holds onto the Entities master table and it's idle
function
Diffstat (limited to 'src/components/IdleFunc.hpp')
-rw-r--r-- | src/components/IdleFunc.hpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/components/IdleFunc.hpp b/src/components/IdleFunc.hpp deleted file mode 100644 index 29bcd7b..0000000 --- a/src/components/IdleFunc.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2019 Belle-Isle, Andrew <drumsetmonkey@gmail.com> - * Author: Belle-Isle, Andrew <drumsetmonkey@gmail.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef IDLEFUNC_HPP_ -#define IDLEFUNC_HPP_ - -#include <components/Component.hpp> - -struct IdleFunc : Component<IdleFunc>, entityx::Component<IdleFunc> -{ - sol::function luafunc; - public: - IdleFunc() {} - - IdleFunc FromLua(sol::object ref) - { - if (ref.get_type() == sol::type::function) { - this->luafunc = ref; - } - return *this; - } -}; - -#endif//IDLEFUNC_HPP_ |