15 #ifndef SCRIPTING_LUA_API_HPP
16 #define SCRIPTING_LUA_API_HPP
71 lua_unit(
size_t u): uid(u), ptr(), side(0), c_ptr() {}
73 lua_unit(
int s,
size_t u): uid(u), ptr(), side(s), c_ptr() {}
76 bool on_map()
const {
return !ptr && side == 0; }
unit & luaW_checkunit(lua_State *L, int index, bool only_on_map=false)
Converts a Lua value to a unit pointer.
unit * luaW_tounit(lua_State *L, int index, bool only_on_map=false)
Converts a Lua value to a unit pointer.
lua_unit(int s, size_t u)
unit_ptr luaW_tounit_ptr(lua_State *L, int index, bool only_on_map)
Similar to luaW_checkunit/luaW_tounit but returns a unit_ptr, use this instead of luaW_checkunit/luaW...
bool luaW_pcall(lua_State *L, int nArgs, int nRets, bool allow_wml_error=false)
Calls a Lua function stored below its nArgs arguments at the top of the stack.
Encapsulates the map of the game.
Storage for a unit, either owned by the Lua code (ptr != 0), a local variable unit (c_ptr != 0)...
int on_recall_list() const
void chat_message(std::string const &caption, std::string const &msg)
Displays a message in the chat window.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
lua_unit * luaW_pushlocalunit(lua_State *L, unit &u)
unit_ptr luaW_checkunit_ptr(lua_State *L, int index, bool only_on_map)
boost::intrusive_ptr< unit > unit_ptr
bool put_map(const map_location &loc)
lua_unit(lua_unit const &)
GLsizei const GLcharARB ** string