The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lua_unit Class Reference

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
 
unitget ()
 
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
 
unitc_ptr
 

Detailed Description

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.

Constructor & Destructor Documentation

lua_unit::lua_unit ( lua_unit const &  )
private
lua_unit::lua_unit ( size_t  u)
inline

Definition at line 71 of file lua_api.hpp.

lua_unit::lua_unit ( unit_ptr  u)
inline

Definition at line 72 of file lua_api.hpp.

lua_unit::lua_unit ( int  s,
size_t  u 
)
inline

Definition at line 73 of file lua_api.hpp.

lua_unit::lua_unit ( unit u)
inline

Definition at line 74 of file lua_api.hpp.

lua_unit::~lua_unit ( )

Definition at line 113 of file lua_api.cpp.

Member Function Documentation

void lua_unit::clear_ref ( )
inline

Definition at line 81 of file lua_api.hpp.

Referenced by game_lua_kernel::apply_effect().

unit * lua_unit::get ( )
unit_ptr lua_unit::get_shared ( )
bool lua_unit::on_map ( ) const
inline
int lua_unit::on_recall_list ( ) const
inline
bool lua_unit::put_map ( const map_location loc)

Member Data Documentation

unit* lua_unit::c_ptr
private

Definition at line 67 of file lua_api.hpp.

Referenced by get().

unit_ptr lua_unit::ptr
private

Definition at line 65 of file lua_api.hpp.

Referenced by get(), get_shared(), and put_map().

int lua_unit::side
private

Definition at line 66 of file lua_api.hpp.

Referenced by get(), get_shared(), on_recall_list(), and put_map().

size_t lua_unit::uid
private

Definition at line 64 of file lua_api.hpp.

Referenced by get(), get_shared(), and put_map().


The documentation for this class was generated from the following files: