]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackTypeMenu.h
moved attack type into its own class
[l2e.git] / src / battle / AttackTypeMenu.h
1 /*
2  * AttackTypeMenu.h
3  *
4  *  Created on: Aug 6, 2012
5  *      Author: holy
6  */
7
8 #ifndef BATTLE_ATTACKTYPEMENU_H_
9 #define BATTLE_ATTACKTYPEMENU_H_
10
11 #include "AttackChoice.h"
12 #include "../geometry/Point.h"
13 #include "../graphics/Sprite.h"
14
15 #include <SDL.h>
16
17 namespace battle {
18
19 class AttackTypeMenu {
20
21 public:
22         explicit AttackTypeMenu(const graphics::Sprite *icons)
23         : icons(icons), selected(AttackChoice::SWORD) { }
24
25 public:
26         void Select(AttackChoice::Type t) { selected = t; }
27         AttackChoice::Type Selected() const { return selected; }
28         void Render(SDL_Surface *screen, const geometry::Point<int> &position);
29
30         int Width() const { return 3 * IconWidth(); }
31         int Height() const { return 3 * IconHeight(); }
32         int IconWidth() const { return icons->Width(); }
33         int IconHeight() const { return icons->Height(); }
34
35 private:
36         const graphics::Sprite *icons;
37         AttackChoice::Type selected;
38
39 };
40
41 }
42
43 #endif /* BATTLE_ATTACKTYPEMENU_H_ */