X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FAttackTypeMenu.h;h=5f10c463f18b68d492c94ed38eb910cd54861b34;hb=667e1d9c6a78d0b608b518a4e5b5c31bc30e4e89;hp=b63ec97e53e55109c6abb2f4ec3f2f3378dd5fc9;hpb=c0860451b5fd681c3b3b8d985e8831276bbd917f;p=l2e.git diff --git a/src/battle/AttackTypeMenu.h b/src/battle/AttackTypeMenu.h index b63ec97..5f10c46 100644 --- a/src/battle/AttackTypeMenu.h +++ b/src/battle/AttackTypeMenu.h @@ -1,17 +1,9 @@ -/* - * AttackTypeMenu.h - * - * Created on: Aug 6, 2012 - * Author: holy - */ - #ifndef BATTLE_ATTACKTYPEMENU_H_ #define BATTLE_ATTACKTYPEMENU_H_ -namespace app { class Input; } -namespace graphics { class Sprite; } - -#include "../geometry/Point.h" +#include "AttackChoice.h" +#include "../math/Vector.h" +#include "../graphics/Sprite.h" #include @@ -19,30 +11,28 @@ 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 ReadInput(const app::Input &); - Icon Selected() const { return selected; } - void Render(SDL_Surface *screen, const geometry::Point ¢er); + void Select(AttackChoice::Type t) { selected = t; } + AttackChoice::Type Selected() const { return selected; } + void Render(SDL_Surface *screen, const math::Vector &position); + + int Width() const { return 3 * IconWidth(); } + int Height() const { return 3 * IconHeight(); } + math::Vector Size() const { return 3 * IconSize(); } + int IconWidth() const { return icons->Width(); } + int IconHeight() const { return icons->Height(); } + const math::Vector &IconSize() const { return icons->Size(); } private: const graphics::Sprite *icons; - Icon selected; + AttackChoice::Type selected; }; } -#endif /* BATTLE_ATTACKTYPEMENU_H_ */ +#endif