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 | Static Private Attributes | List of all members
n_unit::id_manager Class Reference

#include <id.hpp>

Public Member Functions

 id_manager (size_t next_id)
 
unit_id next_id ()
 returns id for unit that is created More...
 
unit_id next_fake_id ()
 
size_t get_save_id () const
 Used for saving id to savegame. More...
 
void set_save_id (size_t)
 
void clear ()
 Clears id counter after game. More...
 
void reset_fake ()
 

Private Member Functions

 id_manager ()
 

Private Attributes

size_t next_id_
 
size_t fake_id_
 

Static Private Attributes

static id_manager manager_
 

Detailed Description

Definition at line 45 of file id.hpp.

Constructor & Destructor Documentation

n_unit::id_manager::id_manager ( )
private

Definition at line 27 of file id.cpp.

n_unit::id_manager::id_manager ( size_t  next_id)
inline

Definition at line 53 of file id.hpp.

Member Function Documentation

void n_unit::id_manager::clear ( )

Clears id counter after game.

Definition at line 61 of file id.cpp.

References next_id_, and reset_fake().

Referenced by set_save_id().

size_t n_unit::id_manager::get_save_id ( ) const

Used for saving id to savegame.

Definition at line 44 of file id.cpp.

References next_id_.

Referenced by synced_context::get_unit_id_diff(), actions::undo_list::redo(), actions::undo_list::undo(), and game_board::write_config().

unit_id n_unit::id_manager::next_fake_id ( )
unit_id n_unit::id_manager::next_id ( )

returns id for unit that is created

Definition at line 30 of file id.cpp.

References n_unit::unit_id::create_real(), DBG_UT, n_unit::unit_id::highest_bit, and next_id_.

Referenced by unit::clone(), and unit::set_underlying_id().

void n_unit::id_manager::reset_fake ( )

Definition at line 56 of file id.cpp.

References fake_id_.

Referenced by clear(), and play_controller::finish_side_turn().

void n_unit::id_manager::set_save_id ( size_t  id)

Definition at line 49 of file id.cpp.

References clear(), DBG_UT, and next_id_.

Referenced by actions::undo_list::redo(), and actions::undo_list::undo().

Member Data Documentation

size_t n_unit::id_manager::fake_id_
private

Definition at line 49 of file id.hpp.

Referenced by next_fake_id(), and reset_fake().

id_manager n_unit::id_manager::manager_
staticprivate

Definition at line 50 of file id.hpp.

size_t n_unit::id_manager::next_id_
private

Definition at line 48 of file id.hpp.

Referenced by clear(), get_save_id(), next_id(), and set_save_id().


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