Example #1
0
        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();
                }
            }
        }
Example #2
0
 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();
             }
         }
     }
 }
Example #3
0
 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();
         }
     }
 }