public void PlayerWarp(Warp warp) { foreach (Model model in ModelList) { if (model is MapModel) { MapModel mapModel = (MapModel)model; switch (warp) { case Warp.LEFT: if (mapModel.CurrentMap > 0) { mapModel.CurrentMap--; } break; case Warp.RIGHT: mapModel.CurrentMap++; break; default: break; } mapModel.Update(); } } }
public override void MapChanged(int newMap) { foreach (Model model in ModelList) { if (model is MapModel) { MapModel mapModel = (MapModel)model; if (newMap >= 0 && newMap <= 4) { mapModel.CurrentMap = newMap; mapModel.Update(); } } } }
public void PlayerStartBattle(Monster monster) { foreach (Model model in ModelList) { if (model is MainModel) { MainModel mainModel = (MainModel)model; mainModel.GameStatus = "Battle"; mainModel.MonsterBattle = monster; mainModel.Update(); } } foreach (Model model in ModelList) { if (model is MapModel) { MapModel mapModel = (MapModel)model; mapModel.Update(); } } }