_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
#include <unit_cache.h>
◆ const_iterator
◆ iterator
◆ CUnitCache()
CUnitCache::CUnitCache |
( |
| ) |
|
|
inline |
◆ begin() [1/2]
◆ begin() [2/2]
◆ clear()
void CUnitCache::clear |
( |
| ) |
|
|
inline |
◆ end() [1/2]
◆ end() [2/2]
◆ find()
template<typename _T >
CUnit* CUnitCache::find |
( |
const _T & |
pred | ) |
const |
|
inline |
Find the first unit in a tile cache for which a predicate is true.
- Parameters
-
pred | A predicate object vith bool operator()(const CUnit *). |
- Returns
- The first unit u in the cache such that
pred(u)
is true, or NULL if no such unit exists.
◆ for_each()
template<typename _T >
void CUnitCache::for_each |
( |
const _T |
functor | ) |
|
|
inline |
Apply a function to every element of a cache.
- Parameters
-
functor | A unary function object vith void operator()(CUnit *). |
- Returns
- count of visited element.
Applies the function object f
to each element in the cache. functor
must not modify the order of the cache.
◆ for_each_if()
template<typename _T >
int CUnitCache::for_each_if |
( |
const _T & |
functor | ) |
|
|
inline |
Apply a function to every element of a cache.
- Parameters
-
functor | A unary function object vith bool operator()(CUnit *). |
- Returns
- count of visited element.
Applies the function object f
to each element in the cache. functor
must not modify the order of the cache. If functor
return false then loop is exited.
◆ Insert()
Insert new unit into tile cache.
- Parameters
-
unit | Unit pointer to place in cache. |
◆ InsertS()
bool CUnitCache::InsertS |
( |
CUnit * |
unit | ) |
|
|
inline |
Insert new unit into tile cache. Sorted version for binary searching.
- Parameters
-
unit | Unit pointer to place in cache. |
- Returns
- false if unit is already in cache and nothing is added.
◆ operator[]() [1/2]
CUnit* CUnitCache::operator[] |
( |
const unsigned int |
index | ) |
|
|
inline |
◆ operator[]() [2/2]
CUnit* CUnitCache::operator[] |
( |
const unsigned int |
index | ) |
const |
|
inline |
◆ Remove() [1/2]
CUnit* CUnitCache::Remove |
( |
const unsigned int |
index | ) |
|
|
inline |
Remove unit on index from unit cache.
- Parameters
-
index | Unit index to remove from container. |
- Returns
- pointer to removed element.
◆ Remove() [2/2]
bool CUnitCache::Remove |
( |
CUnit *const |
unit | ) |
|
|
inline |
Remove unit from unit cache.
- Parameters
-
unit | Unit pointer to remove from container. |
◆ RemoveS()
void CUnitCache::RemoveS |
( |
CUnit *const |
unit | ) |
|
|
inline |
Remove unit from unit cache.
- Parameters
-
unit | Unit pointer to remove from container. |
◆ size()
size_t CUnitCache::size |
( |
| ) |
const |
|
inline |
◆ Units
std::vector<CUnit *> CUnitCache::Units |
The documentation for this class was generated from the following file:
(C) Copyright 1998-2012 by The