_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Types | Public Member Functions | List of all members
CUnitManager Class Reference

#include <unit_manager.h>

Public Types

typedef std::vector< CUnit * >::iterator Iterator
 

Public Member Functions

const std::vector< CUnit * > & GetUnits () const
 
unit_manager.cpp - Unit manager.
 CUnitManager ()
 Unit manager. More...
 
void Init ()
 
CUnitAllocUnit ()
 
void ReleaseUnit (CUnit *unit)
 
void Save (CFile &file) const
 
void Load (lua_State *Lua)
 
void Add (CUnit *unit)
 
Iterator begin ()
 
Iterator end ()
 
bool empty () const
 
CUnitlastCreatedUnit ()
 
CUnitGetSlotUnit (int index) const
 
unsigned int GetUsedSlotCount () const
 

Member Typedef Documentation

◆ Iterator

typedef std::vector<CUnit *>::iterator CUnitManager::Iterator

Constructor & Destructor Documentation

◆ CUnitManager()

CUnitManager::CUnitManager ( )

Unit manager.

Member Function Documentation

◆ Add()

void CUnitManager::Add ( CUnit unit)

◆ AllocUnit()

CUnit * CUnitManager::AllocUnit ( )

Allocate a new unit

Returns
New unit

◆ begin()

CUnitManager::Iterator CUnitManager::begin ( )

◆ empty()

bool CUnitManager::empty ( ) const

◆ end()

CUnitManager::Iterator CUnitManager::end ( )

◆ GetSlotUnit()

CUnit & CUnitManager::GetSlotUnit ( int  index) const

◆ GetUnits()

const std::vector<CUnit *>& CUnitManager::GetUnits ( ) const
inline

◆ GetUsedSlotCount()

unsigned int CUnitManager::GetUsedSlotCount ( ) const

◆ Init()

void CUnitManager::Init ( )

Initial memory allocation for units.

◆ lastCreatedUnit()

CUnit * CUnitManager::lastCreatedUnit ( )

◆ Load()

void CUnitManager::Load ( lua_State *  Lua)

◆ ReleaseUnit()

void CUnitManager::ReleaseUnit ( CUnit unit)

Release a unit

Parameters
unitUnit to release

◆ Save()

void CUnitManager::Save ( CFile file) const

Save state of unit manager to file.

Parameters
fileOutput file.

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.