Public Types | |
typedef std::list< Object * > | Container |
Used container. | |
typedef Container::size_type | SizeType |
Size type of the item. | |
Public Member Functions | |
Item () | |
Default constructor - empty container will be created. | |
~Item () | |
Destructor- removes all objects from the item. | |
Object * | GetTopObject () const |
Returns pointer to the "top" object in the container. | |
void | AddObject (Object *object) |
Adds selected object to the container according to his priority. | |
bool | RemoveObject (Object::Priority priority, bool freeMemory=true) |
Removes object with selected priority from the container. | |
bool | RemoveTopObject (bool freeMemory=true) |
Removes "top" object from the container. | |
void | RemoveAllObjects (bool freeMemory=true) |
Removes all objects from the container. | |
bool | IsThereObject () const |
Returns true if there is an object in the container. | |
template<class Function> | |
void | ApplyFunctionToEachObject (Function func, bool reversedPass=false) |
Applies the unary function func to each of the elements in the container. | |
template<class Predicate> | |
void | RemoveObjectsAccToPredicate (Predicate pred) |
Removes all elements in the container for which the predicate pred returns true. | |
Private Attributes | |
Container | container |
Container. |
These items will contain objects that can be on the one place at the same time (e.g trail and agent).
std::list< Object * > Matrix::Item::Container |
Used container.
typedef Container::size_type Matrix::Item::SizeType |
Size type of the item.
Matrix::Item::Item | ( | ) | [inline] |
Default constructor - empty container will be created.
Matrix::Item::~Item | ( | ) | [inline] |
Destructor- removes all objects from the item.
void Matrix::Item::AddObject | ( | Object * | object | ) |
Adds selected object to the container according to his priority.
object | Object that has to be added into container |
void Matrix::Item::ApplyFunctionToEachObject | ( | Function | func, | |
bool | reversedPass = false | |||
) | [inline] |
Applies the unary function func to each of the elements in the container.
func | Unary function that has to be applied | |
reversedPass | If true, container will be passed reversed |
Object* Matrix::Item::GetTopObject | ( | ) | const [inline] |
Returns pointer to the "top" object in the container.
If there is no object in the container it returns 0
bool Matrix::Item::IsThereObject | ( | ) | const [inline] |
Returns true if there is an object in the container.
void Matrix::Item::RemoveAllObjects | ( | bool | freeMemory = true |
) |
Removes all objects from the container.
freeMemory | If true object's memory will be freed |
bool Matrix::Item::RemoveObject | ( | Object::Priority | priority, | |
bool | freeMemory = true | |||
) |
Removes object with selected priority from the container.
priority | Object's priority | |
freeMemory | If true object's memory will be freed |
void Matrix::Item::RemoveObjectsAccToPredicate | ( | Predicate | pred | ) | [inline] |
Removes all elements in the container for which the predicate pred returns true.
pred | Predicate that returns true/false |
bool Matrix::Item::RemoveTopObject | ( | bool | freeMemory = true |
) |
Removes "top" object from the container.
freeMemory | If true object's memory will be freed |
Container Matrix::Item::container [private] |
Container.