#ifndef MAP_MAP_H_
#define MAP_MAP_H_
+#include "Entity.h"
#include "fwd.h"
#include "../geometry/Vector.h"
#include "../graphics/fwd.h"
SDL_Surface *BattleBackgroundAt(const geometry::Vector<int> &);
geometry::Vector<int> TileCoordinates(const geometry::Vector<int> &) const;
- Entity **EntitiesBegin() { return &entities; }
- Entity **EntitiesEnd() { return (&entities) + numEntities; }
+ Entity *EntitiesBegin() { return entities; }
+ Entity *EntitiesEnd() { return entities + numEntities; }
void Render(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
void RenderDebug(SDL_Surface *dest, const geometry::Vector<int> &offset) const;
void MapState::LoadMap(Map *m) {
map = m;
- entities.insert(entities.end(), m->EntitiesBegin(), m->EntitiesEnd());
+ for (Entity *e(m->EntitiesBegin()), *end(m->EntitiesEnd()); e != end; ++e) {
+ entities.push_back(e);
+ }
for (Entity *e(controlled); e; e = e->Follower()) {
entities.push_back(e);
}