]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackTypeMenu.cpp
f9786fb2c2405d1da0311e4038d9d93975cf6ca4
[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/Vector.h"
11 #include "../graphics/Sprite.h"
12
13 using geometry::Vector;
14
15 namespace battle {
16
17 void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Vector<int> &position) {
18         const Vector<int> &swordOffset(IconSize());
19         const Vector<int> magicOffset(IconWidth(), 0);
20         const Vector<int> defendOffset(2 * IconWidth(), IconHeight());
21         const Vector<int> ikariOffset(IconWidth(), 2 * IconHeight());
22         const Vector<int> itemOffset(0, IconHeight());
23
24         icons->Draw(screen, position + swordOffset, AttackChoice::SWORD, (selected == AttackChoice::SWORD) ? 1 : 0);
25         icons->Draw(screen, position + magicOffset, AttackChoice::MAGIC, (selected == AttackChoice::MAGIC) ? 1 : 0);
26         icons->Draw(screen, position + defendOffset, AttackChoice::DEFEND, (selected == AttackChoice::DEFEND) ? 1 : 0);
27         icons->Draw(screen, position + ikariOffset, AttackChoice::IKARI, (selected == AttackChoice::IKARI) ? 1 : 0);
28         icons->Draw(screen, position + itemOffset, AttackChoice::ITEM, (selected == AttackChoice::ITEM) ? 1 : 0);
29 }
30
31 }