-/*
- * StatusMenu.cpp
- *
- * Created on: Oct 22, 2012
- * Author: holy
- */
-
#include "StatusMenu.h"
#include "HeroStatus.h"
using common::Hero;
using common::Item;
using common::Stats;
-using geometry::Vector;
+using math::Vector;
using graphics::Font;
using graphics::Frame;
Vector<int> lineBreak(0, 2 * parent->Res().statusFont->CharHeight());
Vector<int> position(offset);
- RenderEquipmentLine(hero.Weapon(), screen, position);
-
- position += lineBreak;
- RenderEquipmentLine(hero.Armor(), screen, position);
-
- position += lineBreak;
- RenderEquipmentLine(hero.Shield(), screen, position);
-
- position += lineBreak;
- RenderEquipmentLine(hero.Helmet(), screen, position);
-
- position += lineBreak;
- RenderEquipmentLine(hero.Ring(), screen, position);
-
- position += lineBreak;
- RenderEquipmentLine(hero.Jewel(), screen, position);
+ for (int i = 0; i < Hero::EQUIP_COUNT; ++i) {
+ RenderEquipmentLine(hero.Equipment(Hero::EquipSlot(i)), screen, position);
+ position += lineBreak;
+ }
}
void StatusMenu::RenderEquipmentLine(const Item *item, SDL_Surface *screen, const Vector<int> &position) const {
}
}
-void StatusMenu::RenderExperience(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+void StatusMenu::RenderExperience(SDL_Surface *screen, const math::Vector<int> &offset) const {
const Font &font(*parent->Res().statusFont);
font.DrawStringRight(parent->Res().experienceLabel, screen, offset, 10);
font.DrawNumberRight(GetHero().Experience(), screen, numberOffset, 7);
}
-void StatusMenu::RenderNextLevel(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+void StatusMenu::RenderNextLevel(SDL_Surface *screen, const math::Vector<int> &offset) const {
const Font &font(*parent->Res().statusFont);
font.DrawStringRight(parent->Res().nextLevelLabel, screen, offset, 10);
font.DrawNumberRight(GetHero().NextLevel(), screen, numberOffset, 7);
}
-void StatusMenu::RenderIkari(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+void StatusMenu::RenderIkari(SDL_Surface *screen, const math::Vector<int> &offset) const {
const Font &font(*parent->Res().statusFont);
font.DrawString(parent->Res().ipLabel, screen, offset, 5);
font.DrawChar('%', screen, percentOffset);
}
-void StatusMenu::RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+void StatusMenu::RenderMenu(SDL_Surface *screen, const math::Vector<int> &offset) const {
const Font &font(*parent->Res().normalFont);
const Frame &frame(*parent->Res().statusFrame);