]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackTypeMenu.h
added battle move menu
[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 "../geometry/Point.h"
12 #include "../graphics/Sprite.h"
13
14 #include <SDL.h>
15
16 namespace battle {
17
18 class AttackTypeMenu {
19
20 public:
21         enum Icon {
22                 SWORD,
23                 MAGIC,
24                 DEFEND,
25                 IKARI,
26                 ITEM
27         };
28
29 public:
30         explicit AttackTypeMenu(const graphics::Sprite *icons)
31         : icons(icons), selected(SWORD) { }
32
33 public:
34         void Select(Icon i) { selected = i; }
35         Icon Selected() const { return selected; }
36         void Render(SDL_Surface *screen, const geometry::Point<int> &position);
37
38         int Width() const { return 3 * IconWidth(); }
39         int Height() const { return 3 * IconHeight(); }
40         int IconWidth() const { return icons->Width(); }
41         int IconHeight() const { return icons->Height(); }
42
43 private:
44         const graphics::Sprite *icons;
45         Icon selected;
46
47 };
48
49 }
50
51 #endif /* BATTLE_ATTACKTYPEMENU_H_ */