]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/SmallHeroTag.cpp
extracted battle logic into a class
[l2e.git] / src / battle / SmallHeroTag.cpp
index 7843cc0cba29c62e4884ae814ce3a8886718b20e..408be3bdb547794760bd5c322ac207cb1322df8a 100644 (file)
@@ -1,28 +1,20 @@
-/*
- * SmallHeroTag.cpp
- *
- *  Created on: Aug 11, 2012
- *      Author: holy
- */
-
 #include "SmallHeroTag.h"
 
 #include "BattleState.h"
-#include "../geometry/operators.h"
-#include "../geometry/Vector.h"
+#include "../math/Vector.h"
 #include "../graphics/Font.h"
 #include "../graphics/Frame.h"
 #include "../graphics/Gauge.h"
+#include "../math/Vector.h"
 
-using geometry::Point;
-using geometry::Vector;
+using math::Vector;
 using graphics::Font;
 using graphics::Frame;
 using graphics::Sprite;
 
 namespace battle {
 
-void SmallHeroTag::Render(SDL_Surface *screen, int width, int height, geometry::Point<int> position) const {
+void SmallHeroTag::Render(SDL_Surface *screen, int width, int height, const math::Vector<int> &position) const {
        const Resources &r(battle->Res());
        const Frame *frame((index == battle->MaxHeroes() - 1) ? r.lastSmallHeroTagFrame : r.smallHeroTagFrame);
        const Font *font(r.normalFont);
@@ -30,11 +22,11 @@ void SmallHeroTag::Render(SDL_Surface *screen, int width, int height, geometry::
 
        frame->Draw(screen, position, width, height);
 
-       if (battle->HeroPositionOccupied(index)) {
+       if (battle->GetBattle().HeroPositionOccupied(index)) {
                const Hero &hero(battle->HeroAt(index));
 
                int gaugeWidth(width - 2 * frame->BorderWidth() - labels->Width());
-               Vector<int> nameOffset(frame->BorderWidth(), frame->BorderHeight());
+               Vector<int> nameOffset(frame->BorderSize());
                Vector<int> hpLabelOffset(nameOffset.X(), nameOffset.Y() + font->CharHeight());
                Vector<int> mpLabelOffset(hpLabelOffset.X(), hpLabelOffset.Y() + font->CharHeight());
                Vector<int> ipLabelOffset(mpLabelOffset.X(), mpLabelOffset.Y() + font->CharHeight());