ManaPlus
|
#include <actor.h>
Public Member Functions | |
virtual | ~Actor () |
virtual void | draw (Graphics *const graphics, const int offsetX, const int offsetY) const =0 |
virtual int | getWidth () const |
virtual int | getHeight () const |
const Vector & | getPixelPositionF () const |
virtual void | setPixelPositionF (const Vector &pos) |
int | getPixelX () const |
virtual int | getPixelY () const |
virtual int | getSortPixelY () const |
virtual int | getTileX () const |
virtual int | getTileY () const |
virtual int | getNumberOfLayers () const |
virtual float | getAlpha () const =0 |
virtual void | setAlpha (float alpha)=0 |
virtual void | setMap (Map *const map) |
const Map * | getMap () const |
Data Fields | |
int | mPixelX |
int | mPixelY |
Protected Member Functions | |
Actor () | |
Protected Attributes | |
Map * | mMap |
Vector | mPos |
int | mYDiff |
Private Attributes | |
Actors::iterator | mMapActor |
|
virtual |
|
pure virtual |
Draws the Actor to the given graphics context.
Note: this function could be simplified if the graphics context would support setting a translation offset. It already does this partly with the clipping rectangle support.
Implemented in TextParticle, Particle, ImageParticle, FloorItem, CastingEffect, and Being.
|
pure virtual |
Returns the current alpha value used to draw the actor.
Implemented in Particle, CastingEffect, and ActorSprite.
|
inlinevirtual |
Returns the vertical size of the actors graphical representation in pixels or 0 when it is undefined.
Reimplemented in Being, and ActorSprite.
|
inline |
|
inlinevirtual |
|
inline |
Returns the pixel position of this actor.
Definition at line 76 of file actor.h.
References mPos.
Referenced by FindBeingFunctor::operator()().
|
inline |
Returns the pixels X coordinate of the actor.
Definition at line 87 of file actor.h.
References CAST_S32, mPos, and Vector::x.
Referenced by DebugWindow::draw(), MapLayer::drawFringe(), ActorManager::findBeingByPixel(), ActorManager::findBeingsByPixel(), ActorSprite::getActorX(), getTileX(), and DebugWindow::safeDraw().
|
inlinevirtual |
Returns the pixel Y coordinate of the actor.
Reimplemented in TextParticle, and Particle.
Definition at line 93 of file actor.h.
References CAST_S32, mPos, and Vector::y.
Referenced by DebugWindow::draw(), MapLayer::drawFringe(), ActorManager::findBeingByPixel(), ActorManager::findBeingsByPixel(), ActorSprite::getActorY(), getTileY(), and DebugWindow::safeDraw().
|
inlinevirtual |
|
virtual |
Returns the x coordinate in tiles of the actor.
Reimplemented in FloorItem, and Being.
Definition at line 61 of file actor.cpp.
References getPixelX(), Map::getTileWidth(), and mMap.
|
virtual |
Returns the y coordinate in tiles of the actor.
Reimplemented in FloorItem, and Being.
Definition at line 72 of file actor.cpp.
References getPixelY(), Map::getTileHeight(), and mMap.
|
inlinevirtual |
Returns the horizontal size of the actors graphical representation in pixels or 0 when it is undefined.
Reimplemented in Being, and ActorSprite.
|
pure virtual |
Sets the alpha value used to draw the actor.
Implemented in Particle, ImageParticle, CastingEffect, and ActorSprite.
|
virtual |
Reimplemented in LocalPlayer, Being, and ActorSprite.
Definition at line 48 of file actor.cpp.
References Map::addActor(), mMap, mMapActor, and Map::removeActor().
Referenced by Being::addCast(), Particle::addEffect(), ParticleEngine::addEffect(), ParticleEngine::addTextRiseFadeOutEffect(), ParticleEngine::addTextSplashEffect(), ParticleEngine::createChild(), ParticleEmitter::createParticles(), and ActorSprite::setMap().
|
virtual |
|
protected |
Definition at line 139 of file actor.h.
Referenced by Being::addCast(), Being::botFixOffset(), Being::botLogic(), FloorItem::draw(), LocalPlayer::fixAttackTarget(), getMap(), Being::getMoveAction(), Being::getOffset(), LocalPlayer::getPathLength(), Being::getSitAction(), getTileX(), getTileY(), LocalPlayer::isReachable(), Being::moveBotTo(), LocalPlayer::moveToHome(), LocalPlayer::moveToTarget(), LocalPlayer::navigateClean(), LocalPlayer::navigateTo(), Being::nextTile(), LocalPlayer::pickedUp(), LocalPlayer::pickUp(), LocalPlayer::removeHome(), LocalPlayer::setHome(), setMap(), LocalPlayer::setRealPos(), LocalPlayer::startWalking(), LocalPlayer::updateCoords(), LocalPlayer::updateMusic(), LocalPlayer::updateNavigateList(), and ~Actor().
|
private |
int Actor::mPixelX |
Definition at line 133 of file actor.h.
Referenced by CastingEffect::CastingEffect(), Minimap::draw2(), LocalPlayer::fixAttackTarget(), LocalPlayer::getPathLength(), LocalPlayer::isReachable(), LocalPlayer::logic(), Viewport::moveCameraToActor(), Viewport::moveCameraToPosition(), LocalPlayer::moveToTarget(), LocalPlayer::navigateTo(), LocalPlayer::pickUp(), FloorItem::postInit(), Being::showName(), LocalPlayer::stopWalking(), Being::updateBadgesPosition(), Being::updateCoords(), and LocalPlayer::updateCoords().
int Actor::mPixelY |
Definition at line 134 of file actor.h.
Referenced by CastingEffect::CastingEffect(), Minimap::draw2(), LocalPlayer::fixAttackTarget(), LocalPlayer::getPathLength(), CastingEffect::getSortPixelY(), LocalPlayer::isReachable(), LocalPlayer::logic(), Viewport::moveCameraToActor(), Viewport::moveCameraToPosition(), LocalPlayer::moveToTarget(), LocalPlayer::navigateTo(), LocalPlayer::pickUp(), FloorItem::postInit(), Being::showName(), LocalPlayer::stopWalking(), Being::updateBadgesPosition(), Being::updateCoords(), and LocalPlayer::updateCoords().
|
protected |
Position in pixels relative to map.
Definition at line 140 of file actor.h.
Referenced by getPixelPositionF(), getPixelX(), getPixelY(), Particle::getPixelY(), TextParticle::getPixelY(), getSortPixelY(), Particle::getSortPixelY(), TextParticle::getSortPixelY(), ActorSprite::logic(), Particle::moveTo(), FloorItem::postInit(), Particle::update(), and Particle::updateSelf().
|
protected |
Definition at line 141 of file actor.h.
Referenced by CastingEffect::CastingEffect(), getSortPixelY(), Being::getSortPixelY(), CastingEffect::getSortPixelY(), and FloorItem::postInit().