Mana
|
#include <actorspritemanager.h>
Public Member Functions | |
ActorSpriteManager () | |
~ActorSpriteManager () | |
void | setMap (Map *map) |
Sets the map on which ActorSprites are created. | |
void | setPlayer (LocalPlayer *player) |
Sets the current player. | |
Being * | createBeing (int id, ActorSprite::Type type, int subtype) |
Create a Being and add it to the list of ActorSprites. | |
FloorItem * | createItem (int id, int itemId, const Vector &position) |
Create a FloorItem and add it to the list of ActorSprites. | |
void | destroyActor (ActorSprite *actor) |
Immediately destroys the given actor. | |
void | scheduleDelete (ActorSprite *actor) |
Destroys the given ActorSprite at the end of ActorSpriteManager::logic. | |
Being * | findBeing (int id) const |
Returns a specific Being, by id;. | |
Being * | findBeing (int x, int y, ActorSprite::Type type=ActorSprite::UNKNOWN) const |
Returns a being at specific coordinates. | |
Being * | findBeingByPixel (int x, int y) const |
Returns a being at the specific pixel. | |
FloorItem * | findItem (int id) const |
Returns a specific FloorItem, by id. | |
FloorItem * | findItem (int x, int y, int maxDist=0) const |
Returns a FloorItem at specific coordinates. | |
Being * | findNearestLivingBeing (int x, int y, int maxTileDist, ActorSprite::Type type=Being::UNKNOWN, Being *excluded=nullptr) const |
Returns a being nearest to specific coordinates. | |
Being * | findNearestLivingBeing (Being *aroundBeing, int maxTileDist, ActorSprite::Type type=Being::UNKNOWN) const |
Returns a being nearest to another being. | |
Being * | findBeingByName (const std::string &name, ActorSprite::Type type=Being::UNKNOWN) const |
Finds a being by name and (optionally) by type. | |
const ActorSprites & | getAll () const |
Returns the whole list of beings. | |
bool | hasActorSprite (ActorSprite *someActor) const |
Returns true if the given ActorSprite is in the manager's list, false otherwise. | |
void | logic () |
Performs ActorSprite logic and deletes ActorSprite scheduled to be deleted. | |
void | clear () |
Destroys all ActorSprites except the local player. | |
AutoCompleteLister * | getPlayerNameLister () const |
AutoCompleteLister * | getPlayerNPCNameLister () const |
void | updatePlayerNames () |
void | event (Event::Channel channel, const Event &event) override |
![]() | |
virtual | ~EventListener () |
void | listen (Event::Channel channel) |
void | ignore (Event::Channel channel) |
Protected Attributes | |
std::unique_ptr< AutoCompleteLister > | mPlayerNames |
std::unique_ptr< AutoCompleteLister > | mPlayerNPCNames |
ActorSprites | mActors |
ActorSprites | mDeleteActors |
Map * | mMap |
Friends | |
class | PlayerNamesLister |
class | PlayerNPCNamesLister |
Definition at line 38 of file actorspritemanager.h.
ActorSpriteManager::ActorSpriteManager | ( | ) |
Definition at line 66 of file actorspritemanager.cpp.
ActorSpriteManager::~ActorSpriteManager | ( | ) |
Definition at line 74 of file actorspritemanager.cpp.
void ActorSpriteManager::clear | ( | ) |
Destroys all ActorSprites except the local player.
Definition at line 275 of file actorspritemanager.cpp.
Being * ActorSpriteManager::createBeing | ( | int | id, |
ActorSprite::Type | type, | ||
int | subtype | ||
) |
Create a Being and add it to the list of ActorSprites.
Definition at line 93 of file actorspritemanager.cpp.
Create a FloorItem and add it to the list of ActorSprites.
id | the unique ID of this item instance |
itemId | the item ID |
position | the position in pixels |
Definition at line 101 of file actorspritemanager.cpp.
void ActorSpriteManager::destroyActor | ( | ActorSprite * | actor | ) |
Immediately destroys the given actor.
Definition at line 109 of file actorspritemanager.cpp.
|
overridevirtual |
Implements EventListener.
Definition at line 366 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findBeing | ( | int | id | ) | const |
Returns a specific Being, by id;.
Definition at line 124 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findBeing | ( | int | x, |
int | y, | ||
ActorSprite::Type | type = ActorSprite::UNKNOWN |
||
) | const |
Returns a being at specific coordinates.
Definition at line 134 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findBeingByName | ( | const std::string & | name, |
ActorSprite::Type | type = Being::UNKNOWN |
||
) | const |
Finds a being by name and (optionally) by type.
Definition at line 240 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findBeingByPixel | ( | int | x, |
int | y | ||
) | const |
Returns a being at the specific pixel.
Definition at line 166 of file actorspritemanager.cpp.
FloorItem * ActorSpriteManager::findItem | ( | int | id | ) | const |
Returns a specific FloorItem, by id.
Definition at line 210 of file actorspritemanager.cpp.
FloorItem * ActorSpriteManager::findItem | ( | int | x, |
int | y, | ||
int | maxDist = 0 |
||
) | const |
Returns a FloorItem at specific coordinates.
Definition at line 221 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findNearestLivingBeing | ( | Being * | aroundBeing, |
int | maxTileDist, | ||
ActorSprite::Type | type = Being::UNKNOWN |
||
) | const |
Returns a being nearest to another being.
aroundBeing | The being to search around. |
maxTileDist | Maximal distance in tiles. If minimal distance is larger, no being is returned. |
type | The type of being to look for. |
Definition at line 329 of file actorspritemanager.cpp.
Being * ActorSpriteManager::findNearestLivingBeing | ( | int | x, |
int | y, | ||
int | maxTileDist, | ||
ActorSprite::Type | type = Being::UNKNOWN , |
||
Being * | excluded = nullptr |
||
) | const |
Returns a being nearest to specific coordinates.
x | X coordinate in pixels. |
y | Y coordinate in pixels. |
maxTileDist | Maximal distance in tiles. If minimal distance is larger, no being is returned. |
type | The type of being to look for. |
excluded | The being to exclude from the search. |
Definition at line 289 of file actorspritemanager.cpp.
const ActorSprites & ActorSpriteManager::getAll | ( | ) | const |
Returns the whole list of beings.
Definition at line 256 of file actorspritemanager.cpp.
AutoCompleteLister * ActorSpriteManager::getPlayerNameLister | ( | ) | const |
Definition at line 343 of file actorspritemanager.cpp.
AutoCompleteLister * ActorSpriteManager::getPlayerNPCNameLister | ( | ) | const |
Definition at line 348 of file actorspritemanager.cpp.
bool ActorSpriteManager::hasActorSprite | ( | ActorSprite * | someActor | ) | const |
Returns true if the given ActorSprite is in the manager's list, false otherwise.
someActor | the ActorSprite to search for |
Definition at line 338 of file actorspritemanager.cpp.
void ActorSpriteManager::logic | ( | ) |
Performs ActorSprite logic and deletes ActorSprite scheduled to be deleted.
Definition at line 261 of file actorspritemanager.cpp.
void ActorSpriteManager::scheduleDelete | ( | ActorSprite * | actor | ) |
Destroys the given ActorSprite at the end of ActorSpriteManager::logic.
Definition at line 116 of file actorspritemanager.cpp.
void ActorSpriteManager::setMap | ( | Map * | map | ) |
Sets the map on which ActorSprites are created.
Definition at line 79 of file actorspritemanager.cpp.
void ActorSpriteManager::setPlayer | ( | LocalPlayer * | player | ) |
Sets the current player.
Definition at line 87 of file actorspritemanager.cpp.
void ActorSpriteManager::updatePlayerNames | ( | ) |
Definition at line 353 of file actorspritemanager.cpp.
|
friend |
Definition at line 170 of file actorspritemanager.h.
|
friend |
Definition at line 171 of file actorspritemanager.h.
|
protected |
Definition at line 175 of file actorspritemanager.h.
|
protected |
Definition at line 176 of file actorspritemanager.h.
|
protected |
Definition at line 177 of file actorspritemanager.h.
|
protected |
Definition at line 173 of file actorspritemanager.h.
|
protected |
Definition at line 174 of file actorspritemanager.h.