X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FAttackTypeMenu.h;h=db07443fd7e008ba26c7045e6108beb162a61cba;hb=520af5a8ef4fdfd4156377d4fccd93eecd450f0f;hp=26a9dd9d07089ea128fe566c884c01fd0d30d045;hpb=628b3a7276d0b330719e05504b23bafcf88f8fca;p=l2e.git diff --git a/src/battle/AttackTypeMenu.h b/src/battle/AttackTypeMenu.h index 26a9dd9..db07443 100644 --- a/src/battle/AttackTypeMenu.h +++ b/src/battle/AttackTypeMenu.h @@ -8,7 +8,8 @@ #ifndef BATTLE_ATTACKTYPEMENU_H_ #define BATTLE_ATTACKTYPEMENU_H_ -#include "../geometry/Point.h" +#include "AttackChoice.h" +#include "../geometry/Vector.h" #include "../graphics/Sprite.h" #include @@ -17,32 +18,25 @@ namespace battle { class AttackTypeMenu { -public: - enum Icon { - SWORD, - MAGIC, - DEFEND, - IKARI, - ITEM - }; - public: explicit AttackTypeMenu(const graphics::Sprite *icons) - : icons(icons), selected(SWORD) { } + : icons(icons), selected(AttackChoice::SWORD) { } public: - void Select(Icon i) { selected = i; } - Icon Selected() const { return selected; } - void Render(SDL_Surface *screen, const geometry::Point &position); + void Select(AttackChoice::Type t) { selected = t; } + AttackChoice::Type Selected() const { return selected; } + void Render(SDL_Surface *screen, const geometry::Vector &position); int Width() const { return 3 * IconWidth(); } int Height() const { return 3 * IconHeight(); } + geometry::Vector Size() const { return 3 * IconSize(); } int IconWidth() const { return icons->Width(); } int IconHeight() const { return icons->Height(); } + const geometry::Vector &IconSize() const { return icons->Size(); } private: const graphics::Sprite *icons; - Icon selected; + AttackChoice::Type selected; };