diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-05-17 19:16:11 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-17 21:49:16 -0600 |
commit | 3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d (patch) | |
tree | ed0e8cc5b608c31ac79e6d1de03d9ddfc74fa339 /src/gui/minimap.cpp | |
parent | 51945aa1af6f2a6dc15027ef40cf0ccf424d46e1 (diff) | |
download | mana-3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d.tar.gz mana-3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d.tar.bz2 mana-3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d.tar.xz mana-3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d.zip |
Remove Monster, Player, and NPC classes
Instead of having these three subclasses with minor differences, this
commit merges them back into Being. In the future, we can make Beings
that are talkable to some, attackable by others, etc. This also puts
back support for monster equipment.
Also changes remaining references to Being::Type and the constants to
refer to ActorSprite::Type.
Reviewed-by: Freeyorp
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 53d58d2e..b4445d94 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -28,7 +28,6 @@ #include "localplayer.h" #include "log.h" #include "map.h" -#include "player.h" #include "gui/setup.h" #include "gui/userpalette.h" @@ -195,44 +194,35 @@ void Minimap::draw(gcn::Graphics *graphics) const Being *being = (*bi); int dotSize = 2; - switch (being->getType()) + int type = UserPalette::PC; + + if (being == player_node) + { + type = UserPalette::SELF; + dotSize = 3; + } + else if (being->isGM()) + type = UserPalette::GM; + else if (being->isInParty()) + type = UserPalette::PARTY; + else { - case Being::PLAYER: - { - const Player *player = static_cast<const Player*>(being); - - int type = UserPalette::PC; - - if (being == player_node) - { - type = UserPalette::SELF; - dotSize = 3; - } - else if (player->isGM()) - { - type = UserPalette::GM; - } - else if (player->isInParty()) - { - type = UserPalette::PARTY; - } - - graphics->setColor(userPalette->getColor(type)); + switch (being->getType()) + { + case ActorSprite::MONSTER: + graphics->setColor(userPalette->getColor(UserPalette::MONSTER)); break; - } - case Being::MONSTER: - graphics->setColor(userPalette->getColor(UserPalette::MONSTER)); - break; - - case Being::NPC: - graphics->setColor(userPalette->getColor(UserPalette::NPC)); - break; + case ActorSprite::NPC: + graphics->setColor(userPalette->getColor(UserPalette::NPC)); + break; - default: - continue; + default: + continue; + } } + graphics->setColor(userPalette->getColor(type)); const int offsetHeight = (int) ((dotSize - 1) * mHeightProportion); const int offsetWidth = (int) ((dotSize - 1) * mWidthProportion); |