iw5-mod/src/game/scripting/entity.hpp

39 lines
1.0 KiB
C++
Raw Normal View History

2019-01-20 07:21:43 -05:00
#pragma once
#include "game/game.hpp"
namespace game
{
namespace scripting
{
class context;
2019-01-20 16:26:18 -05:00
class event_listener_handle;
2019-01-20 07:21:43 -05:00
class entity final
{
public:
entity();
entity(const entity& other);
entity(context* context, unsigned int entity_id);
~entity();
2019-01-20 16:26:18 -05:00
event_listener_handle on_notify(const std::string& event,
2019-01-20 07:21:43 -05:00
const std::function<void(const std::vector<chaiscript::Boxed_Value>&)>& callback,
bool is_volatile) const;
unsigned int get_entity_id() const;
game::native::scr_entref_t get_entity_reference() const;
chaiscript::Boxed_Value call(const std::string& function,
const std::vector<chaiscript::Boxed_Value>& arguments) const;
void notify(const std::string& event, const std::vector<chaiscript::Boxed_Value>& arguments) const;
void set(const std::string& field, const chaiscript::Boxed_Value& value) const;
chaiscript::Boxed_Value get(const std::string& field) const;
private:
context* context_;
unsigned int entity_id_;
};
}
}