#include <id.hpp>
Public Member Functions | |
id_manager (std::size_t next_id) | |
unit_id | next_id () |
returns id for unit that is created More... | |
unit_id | next_fake_id () |
std::size_t | get_save_id () const |
Used for saving id to savegame. More... | |
void | set_save_id (std::size_t) |
void | clear () |
Clears id counter after game. More... | |
void | reset_fake () |
Static Public Member Functions | |
static id_manager & | global_instance () |
Private Attributes | |
std::size_t | next_id_ |
std::size_t | fake_id_ |
Static Private Attributes | |
static id_manager | manager_ |
void n_unit::id_manager::clear | ( | ) |
Clears id counter after game.
Definition at line 59 of file id.cpp.
References next_id_, and reset_fake().
Referenced by set_save_id().
std::size_t n_unit::id_manager::get_save_id | ( | ) | const |
Used for saving id to savegame.
Definition at line 42 of file id.cpp.
References next_id_.
Referenced by set_scontext_synced::do_final_checkup(), synced_context::get_unit_id_diff(), actions::undo_action_container::undo(), and game_board::write_config().
|
inlinestatic |
Definition at line 61 of file id.hpp.
References manager_.
Referenced by unit::init(), and unit::mark_clone().
unit_id n_unit::id_manager::next_fake_id | ( | ) |
Definition at line 35 of file id.cpp.
References n_unit::unit_id::create_fake(), DBG_UT, fake_id_, and n_unit::unit_id::highest_bit.
Referenced by unit::mark_clone(), and unit::set_underlying_id().
unit_id n_unit::id_manager::next_id | ( | ) |
returns id for unit that is created
Definition at line 28 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::mark_clone(), and unit::set_underlying_id().
void n_unit::id_manager::reset_fake | ( | ) |
void n_unit::id_manager::set_save_id | ( | std::size_t | id | ) |
|
private |
Definition at line 46 of file id.hpp.
Referenced by next_fake_id(), and reset_fake().
|
staticprivate |
Definition at line 47 of file id.hpp.
Referenced by global_instance().
|
private |
Definition at line 45 of file id.hpp.
Referenced by clear(), get_save_id(), next_id(), and set_save_id().