]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackTypeMenu.cpp
moved attack type into its own class
[l2e.git] / src / battle / AttackTypeMenu.cpp
1 /*
2  * AttackTypeMenu.cpp
3  *
4  *  Created on: Aug 6, 2012
5  *      Author: holy
6  */
7
8 #include "AttackTypeMenu.h"
9
10 #include "../geometry/operators.h"
11 #include "../geometry/Vector.h"
12 #include "../graphics/Sprite.h"
13
14 using geometry::Point;
15 using geometry::Vector;
16
17 namespace battle {
18
19 void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Point<int> &position) {
20         Vector<int> swordOffset(IconWidth(), IconHeight());
21         Vector<int> magicOffset(IconWidth(), 0);
22         Vector<int> defendOffset(2 * IconWidth(), IconHeight());
23         Vector<int> ikariOffset(IconWidth(), 2 * IconHeight());
24         Vector<int> itemOffset(0, IconHeight());
25
26         icons->Draw(screen, position + swordOffset, AttackChoice::SWORD, (selected == AttackChoice::SWORD) ? 1 : 0);
27         icons->Draw(screen, position + magicOffset, AttackChoice::MAGIC, (selected == AttackChoice::MAGIC) ? 1 : 0);
28         icons->Draw(screen, position + defendOffset, AttackChoice::DEFEND, (selected == AttackChoice::DEFEND) ? 1 : 0);
29         icons->Draw(screen, position + ikariOffset, AttackChoice::IKARI, (selected == AttackChoice::IKARI) ? 1 : 0);
30         icons->Draw(screen, position + itemOffset, AttackChoice::ITEM, (selected == AttackChoice::ITEM) ? 1 : 0);
31 }
32
33 }