+void MapState::CheckMonster() {
+ Vector<int> coords(map->TileCoordinates(controlled->Position()));
+ Vector<int> neighbor[4];
+ neighbor[0] = Vector<int>(coords.X() - 1, coords.Y()); // W
+ neighbor[1] = Vector<int>(coords.X(), coords.Y() + 1); // S
+ neighbor[2] = Vector<int>(coords.X() + 1, coords.Y()); // E
+ neighbor[3] = Vector<int>(coords.X(), coords.Y() - 1); // N
+
+ for (int i(0); i < 4; ++i) {
+ for (std::vector<Entity *>::iterator e(entities.begin()), end(entities.end()); e != end; ++e) {
+ if ((*e)->Hostile() && map->TileCoordinates((*e)->Position()) == neighbor[i]) {
+ // remove entity, push battle state and transition and halt all other activity
+ }
+ }
+ }
+}
+
+void MapState::CheckTrigger() {
+ Trigger *trigger(map->TriggerAt(Vector<int>(controlled->Position())));
+ if (trigger) {
+ // TODO: run trigger
+ }
+
+}
+