#include <beingmanager.h>
Definition at line 32 of file beingmanager.h.
Public Member Functions | |
| BeingManager () | |
| ~BeingManager () | |
| void | setMap (Map *map) |
| Sets the map on which beings are created. | |
| void | setPlayer (LocalPlayer *player) |
| Sets the current player. | |
| Being * | createBeing (int id, Being::Type type, int subtype) |
| Create a being and add it to the list of beings. | |
| void | destroyBeing (Being *being) |
| Remove a Being. | |
| Being * | findBeing (int id) const |
| Returns a specific id Being. | |
| Being * | findBeing (int x, int y, Being::Type type=Being::UNKNOWN) const |
| Returns a being at specific coordinates. | |
| Being * | findBeingByPixel (int x, int y) const |
| Being * | findNearestLivingBeing (int x, int y, int maxdist, Being::Type type=Being::UNKNOWN) const |
| Returns a being nearest to specific coordinates. | |
| Being * | findBeingByName (const std::string &name, Being::Type type=Being::UNKNOWN) const |
| Finds a being by name and (optionally) by type. | |
| Being * | findNearestLivingBeing (Being *aroundBeing, int maxdist, Being::Type type=Being::UNKNOWN) const |
| Returns a being nearest to another being. | |
| const Beings & | getAll () const |
| Returns the whole list of beings. | |
| bool | hasBeing (Being *being) const |
| Returns true if the given being is in the manager's list, false otherwise. | |
| void | logic () |
| Performs being logic and deletes dead beings when they have been dead long enough. | |
| void | clear () |
| Destroys all beings except the local player. | |
Protected Attributes | |
| Beings | mBeings |
| Map * | mMap |
| BeingManager::BeingManager | ( | ) |
Definition at line 59 of file beingmanager.cpp.
| BeingManager::~BeingManager | ( | ) |
Definition at line 63 of file beingmanager.cpp.
| void BeingManager::setMap | ( | Map * | map | ) |
| void BeingManager::setPlayer | ( | LocalPlayer * | player | ) |
| Being * BeingManager::createBeing | ( | int | id, | |
| Being::Type | type, | |||
| int | subtype | |||
| ) |
| void BeingManager::destroyBeing | ( | Being * | being | ) |
| Being * BeingManager::findBeing | ( | int | id | ) | const |
| Being * BeingManager::findBeing | ( | int | x, | |
| int | y, | |||
| Being::Type | type = Being::UNKNOWN | |||
| ) | const |
| Being * BeingManager::findBeingByPixel | ( | int | x, | |
| int | y | |||
| ) | const |
Definition at line 141 of file beingmanager.cpp.
| Being * BeingManager::findNearestLivingBeing | ( | int | x, | |
| int | y, | |||
| int | maxdist, | |||
| Being::Type | type = Being::UNKNOWN | |||
| ) | const |
Returns a being nearest to specific coordinates.
| x | X coordinate. | |
| y | Y coordinate. | |
| maxdist | Maximal distance. If minimal distance is larger, no being is returned. | |
| type | The type of being to look for. |
Definition at line 221 of file beingmanager.cpp.
| Being * BeingManager::findBeingByName | ( | const std::string & | name, | |
| Being::Type | type = Being::UNKNOWN | |||
| ) | const |
| Being * BeingManager::findNearestLivingBeing | ( | Being * | aroundBeing, | |
| int | maxdist, | |||
| Being::Type | type = Being::UNKNOWN | |||
| ) | const |
Returns a being nearest to another being.
| maxdist | maximal distance. If minimal distance is larger, no being is returned |
Definition at line 264 of file beingmanager.cpp.
| const Beings & BeingManager::getAll | ( | ) | const |
| bool BeingManager::hasBeing | ( | Being * | being | ) | const |
Returns true if the given being is in the manager's list, false otherwise.
| being | the being to search for |
Definition at line 303 of file beingmanager.cpp.
| void BeingManager::logic | ( | ) |
Performs being logic and deletes dead beings when they have been dead long enough.
Definition at line 186 of file beingmanager.cpp.
| void BeingManager::clear | ( | ) |
Beings BeingManager::mBeings [protected] |
Definition at line 122 of file beingmanager.h.
Map* BeingManager::mMap [protected] |
Definition at line 123 of file beingmanager.h.
1.5.5