+ nextDirection = Entity::ORIENTATION_WEST;
+ } else {
+ nextDirection = -1;
+ }
+}
+
+void MapState::UpdateWorld(float deltaT) {
+ if (controlled && controlled->TileLock(map->Tileset()->Width(), map->Tileset()->Height())) {
+ OnTileLock();
+ }
+ for (std::vector<Entity *>::iterator i(entities.begin()), end(entities.end()); i != end; ++i) {
+ (*i)->Update(deltaT);
+ }
+}
+
+void MapState::OnTileLock() {
+ if (moveTimer.Running() && !moveTimer.JustHit()) return;
+
+ Vector<int> nowLock(controlled->Position());
+ if (nowLock != lastLock) {
+ OnGridLock();
+ afterLock = true;
+ moveTimer.Clear();
+ } else if (moveTimer.JustHit()) {
+ OnGridLock();
+ afterLock = true;