The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
n_unit::unit_id Struct Reference

#include <id.hpp>

Public Member Functions

 unit_id ()
 
 unit_id (size_t val)
 
bool is_fake () const
 
bool is_empty () const
 

Static Public Member Functions

static unit_id create_real (size_t val)
 
static unit_id create_fake (size_t val)
 

Public Attributes

size_t value
 

Static Public Attributes

static const size_t highest_bit = static_cast<size_t>(1) << (sizeof(size_t) * 8 - 1)
 

Friends

bool operator< (unit_id a, unit_id b)
 
bool operator<= (unit_id a, unit_id b)
 
bool operator== (unit_id a, unit_id b)
 
bool operator>= (unit_id a, unit_id b)
 
bool operator> (unit_id a, unit_id b)
 

Detailed Description

Definition at line 25 of file id.hpp.

Constructor & Destructor Documentation

n_unit::unit_id::unit_id ( )
inline

Definition at line 27 of file id.hpp.

Referenced by create_fake(), and create_real().

n_unit::unit_id::unit_id ( size_t  val)
inlineexplicit

Definition at line 28 of file id.hpp.

Member Function Documentation

static unit_id n_unit::unit_id::create_fake ( size_t  val)
inlinestatic

Definition at line 36 of file id.hpp.

References unit_id().

Referenced by n_unit::id_manager::next_fake_id().

static unit_id n_unit::unit_id::create_real ( size_t  val)
inlinestatic

Definition at line 35 of file id.hpp.

References unit_id().

Referenced by n_unit::id_manager::next_id(), and unit::unit().

bool n_unit::unit_id::is_empty ( ) const
inline

Definition at line 33 of file id.hpp.

References value.

bool n_unit::unit_id::is_fake ( ) const
inline

Definition at line 32 of file id.hpp.

Referenced by unit::is_visible_to_team().

Friends And Related Function Documentation

bool operator< ( unit_id  a,
unit_id  b 
)
friend

Definition at line 38 of file id.hpp.

bool operator<= ( unit_id  a,
unit_id  b 
)
friend

Definition at line 39 of file id.hpp.

bool operator== ( unit_id  a,
unit_id  b 
)
friend

Definition at line 40 of file id.hpp.

bool operator> ( unit_id  a,
unit_id  b 
)
friend

Definition at line 42 of file id.hpp.

bool operator>= ( unit_id  a,
unit_id  b 
)
friend

Definition at line 41 of file id.hpp.

Member Data Documentation

const size_t n_unit::unit_id::highest_bit = static_cast<size_t>(1) << (sizeof(size_t) * 8 - 1)
static

Definition at line 29 of file id.hpp.

Referenced by n_unit::id_manager::next_fake_id(), and n_unit::id_manager::next_id().

size_t n_unit::unit_id::value

Definition at line 30 of file id.hpp.

Referenced by is_empty(), unit::set_underlying_id(), unit::underlying_id(), and unit::write().


The documentation for this struct was generated from the following file: