#include "../BattleState.h"
#include "../../app/Application.h"
#include "../../app/Input.h"
-#include "../../geometry/operators.h"
-#include "../../geometry/Point.h"
using app::Application;
using app::Input;
-using geometry::Point;
using geometry::Vector;
using std::vector;
}
void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector<int> &offset) {
- // TODO: this should be related to the enemy's width
Vector<int> cursorOffset(cursorIcon->Width() / -2, cursorIcon->Height());
// offset the indicator by 1/8th to the right and top
Vector<int> indicatorOffset(cursorOffset + Vector<int>(cursorIcon->Width() / 8, cursorIcon->Height() / -8));
- vector<Point<int> > positions;
- if (selection->TargetsEnemies()) {
- for (vector<Point<int> >::const_iterator i(battle->MonsterPositions().begin()), end(battle->MonsterPositions().end()); i != end; ++i) {
- positions.push_back(*i);
+ vector<Vector<int> > positions;
+ if (selection->TargetsMonsters()) {
+ for (int i(0), end(battle->MaxMonsters()); i < end; ++i) {
+ positions.push_back(battle->MonsterAt(i).Position());
}
} else {
for (int i(0), end(battle->NumHeroes()); i < end; ++i) {
}
}
if (flipFlop) {
- for (vector<Point<int> >::size_type i(0); i < positions.size(); ++i) {
+ for (vector<Vector<int> >::size_type i(0); i < positions.size(); ++i) {
if (selection->IsSelected(i)) {
cursorIcon->DrawTopRight(screen, positions[i] + indicatorOffset + offset);
}