Symphony Of Empires
UnitManager Class Reference

#include <unit.hpp>

Collaboration diagram for UnitManager:

Public Member Functions

void init (World &world)
 Fill in the relationship vectors for each nation. More...
 
void add_unit (Unit unit, ProvinceId unit_current_province)
 
void remove_unit (UnitId unit)
 
void move_unit (UnitId unit, ProvinceId target_province)
 
std::vector< UnitIdget_province_units (ProvinceId province_id) const
 
ProvinceId get_unit_current_province (UnitId unit_id) const
 

Public Attributes

Eng3D::Freelist< Unitunits
 
std::vector< ProvinceIdunit_province
 
std::vector< std::vector< UnitId > > province_units
 

Detailed Description

Definition at line 157 of file unit.hpp.

Member Function Documentation

◆ add_unit()

void UnitManager::add_unit ( Unit  unit,
ProvinceId  unit_current_province 
)
Todo:
Obtain the cached ID of the newly added unit

Definition at line 121 of file unit.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_province_units()

std::vector<UnitId> UnitManager::get_province_units ( ProvinceId  province_id) const
inline

Definition at line 165 of file unit.hpp.

Here is the caller graph for this function:

◆ get_unit_current_province()

ProvinceId UnitManager::get_unit_current_province ( UnitId  unit_id) const
inline

Definition at line 169 of file unit.hpp.

◆ init()

void UnitManager::init ( World world)

Fill in the relationship vectors for each nation.

Definition at line 117 of file unit.cpp.

◆ move_unit()

void UnitManager::move_unit ( UnitId  unit,
ProvinceId  target_province 
)

Definition at line 151 of file unit.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_unit()

void UnitManager::remove_unit ( UnitId  unit)

Definition at line 138 of file unit.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ province_units

std::vector<std::vector<UnitId> > UnitManager::province_units

Definition at line 176 of file unit.hpp.

◆ unit_province

std::vector<ProvinceId> UnitManager::unit_province

Definition at line 175 of file unit.hpp.

◆ units

Eng3D::Freelist<Unit> UnitManager::units

Definition at line 173 of file unit.hpp.


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