Storage for a unit, either owned by the Lua code (ptr != 0), a local variable unit (c_ptr != 0), on a recall list (side != 0), or on the map. More...
#include <lua_api.hpp>
Public Member Functions | |
lua_unit (size_t u) | |
lua_unit (unit_ptr u) | |
lua_unit (int s, size_t u) | |
lua_unit (unit &u) | |
~lua_unit () | |
bool | on_map () const |
int | on_recall_list () const |
unit * | get () |
unit_ptr | get_shared () |
void | clear_ref () |
bool | put_map (const map_location &loc) |
Private Member Functions | |
lua_unit (lua_unit const &) | |
Private Attributes | |
size_t | uid |
unit_ptr | ptr |
int | side |
unit * | c_ptr |
Storage for a unit, either owned by the Lua code (ptr != 0), a local variable unit (c_ptr != 0), on a recall list (side != 0), or on the map.
Shared units are represented by their underlying ID (uid).
Definition at line 62 of file lua_api.hpp.
|
private |
|
inline |
Definition at line 71 of file lua_api.hpp.
|
inline |
Definition at line 72 of file lua_api.hpp.
|
inline |
Definition at line 73 of file lua_api.hpp.
|
inline |
Definition at line 74 of file lua_api.hpp.
lua_unit::~lua_unit | ( | ) |
Definition at line 113 of file lua_api.cpp.
|
inline |
Definition at line 81 of file lua_api.hpp.
Referenced by game_lua_kernel::apply_effect().
unit * lua_unit::get | ( | ) |
Definition at line 117 of file lua_api.cpp.
References c_ptr, unit_map::find(), unit_map::iterator_base< iter_types >::get_shared_ptr(), ptr, side, resources::teams, uid, resources::units, and unit_map::iterator_base< iter_types >::valid().
Referenced by game_lua_kernel::cfun_builtin_effect(), impl_unit_get(), impl_unit_set(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_match_unit(), and luaW_tounit().
unit_ptr lua_unit::get_shared | ( | ) |
Definition at line 128 of file lua_api.cpp.
References unit_map::find(), unit_map::iterator_base< iter_types >::get_shared_ptr(), ptr, side, resources::teams, uid, resources::units, and unit_map::iterator_base< iter_types >::valid().
Referenced by game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), game_lua_kernel::intf_put_recall_unit(), game_lua_kernel::intf_put_unit(), and luaW_tounit_ptr().
|
inline |
Definition at line 76 of file lua_api.hpp.
Referenced by impl_unit_get(), impl_unit_set(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), game_lua_kernel::intf_put_recall_unit(), game_lua_kernel::intf_put_unit(), luaW_tounit(), and luaW_tounit_ptr().
|
inline |
Definition at line 77 of file lua_api.hpp.
References side.
Referenced by impl_unit_get(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), game_lua_kernel::intf_match_unit(), and game_lua_kernel::intf_put_recall_unit().
bool lua_unit::put_map | ( | const map_location & | loc | ) |
Definition at line 143 of file lua_api.cpp.
References unit_map::erase(), ERR_LUA, unit_map::find(), unit_map::insert(), unit_map::move(), ptr, unit_map::replace(), side, uid, and resources::units.
Referenced by game_lua_kernel::intf_put_unit().
|
private |
Definition at line 67 of file lua_api.hpp.
Referenced by get().
|
private |
Definition at line 65 of file lua_api.hpp.
Referenced by get(), get_shared(), and put_map().
|
private |
Definition at line 66 of file lua_api.hpp.
Referenced by get(), get_shared(), on_recall_list(), and put_map().
|
private |
Definition at line 64 of file lua_api.hpp.
Referenced by get(), get_shared(), and put_map().