#include "../geometry/operators.h"
#include "../graphics/Sprite.h"
+#include <algorithm>
#include <stdexcept>
using app::Application;
heroes.push_back(h);
}
+void BattleState::SwapHeroes(std::vector<Hero>::size_type lhs, std::vector<Hero>::size_type rhs) {
+ if (lhs < 0 || lhs >= heroes.size() || rhs < 0 || rhs >= heroes.size() || lhs == rhs) return;
+ std::swap(heroes[lhs], heroes[rhs]);
+}
+
void BattleState::Resize(int w, int h) {
LoadSpellMenu(i);
ikariMenus.push_back(res->ikariMenuPrototype);
LoadIkariMenu(i);
- heroTags[i] = HeroTag(&heroes[i], attackChoices + i, res, HeroTag::Alignment((i + 1) % 2));
+ heroTags[i] = HeroTag(this, i);
}
int tagHeight(attackTypeMenu.Height());