Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/interfaces/StarScriptedEntity.hpp
blob: 40aa55276e303f4d5c99459ac833ff00790833e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef STAR_SCRIPTED_ENTITY_HPP
#define STAR_SCRIPTED_ENTITY_HPP

#include "StarEntity.hpp"
#include "StarLua.hpp"

namespace Star {

STAR_CLASS(ScriptedEntity);

// All ScriptedEntity methods should only be called on master entities
class ScriptedEntity : public virtual Entity {
public:
  // Call a script function directly with the given arguments, should return
  // nothing only on failure.
  virtual Maybe<LuaValue> callScript(String const& func, LuaVariadic<LuaValue> const& args) = 0;

  // Execute the given code directly in the underlying context, return nothing
  // on failure.
  virtual Maybe<LuaValue> evalScript(String const& code) = 0;
};

}

#endif