Exemple #1
0
 public void Load(string newLevel) //loads the level from either Filer or LevelDesigner
 {
     //if (newLevel.Contains('@') || newLevel.Contains('+'))
     //{
     //    Level = newLevel.Split(',');
     //}
     Level = Filer.Load(newLevel).Split(',');
 }
        public void Load()
        {
            string[] newLevel = FilerView.Load();
            string   filename = newLevel[0];
            string   rawLevel = newLevel[1];

            Filer.SetString(rawLevel);
            string level = Filer.Load(filename);

            Designer.Load(level);
        }
Exemple #3
0
        public void Move(Direction d)
        {
            Position[] movePositions = Game.Move(d);
            View.SetMoves(Game.GetMoveCount());

            foreach (Position p in movePositions)
            {
                View.SetGamePosition(p.Row, p.Column, Game.GetPartAt(p.Row, p.Column));
            }

            if (Game.IsFinished())
            {
                string player    = GetPlayerName();
                string fileName  = Game.GetName();
                string file      = Filer.Load(fileName);
                int    thisScore = Game.GetMoveCount();
                Filer.ReplaceFile(fileName, FM.GetFileWithNewStatInserted(fileName, player, thisScore));
                string[] bestScore = FM.GetBestStat(file).Split('-');
                View.FinishGame(bestScore[0], bestScore[1], thisScore);
            }
        }
Exemple #4
0
 public void LoadGame()
 {
     try
     {
         string[] newLevel = FilerView.Load();
         string   rawLevel = newLevel[1];
         Filer.SetString(rawLevel);
         string level = Filer.Load();
         Game.Load(level);
         int rows = GameFileable.GetRowCount();
         int cols = GameFileable.GetColumnCount();
         BuildGameLevel(cols, rows);
     }
     catch (ArgumentException e)
     {
         GameView.Display(e.Message);
     }
 }
Exemple #5
0
 public void LoadDesign()
 {
     try
     {
         string[] newLevel = FilerView.Load();
         string   rawLevel = newLevel[1];
         Filer.SetString(rawLevel);
         string level = Filer.Load();
         //DesignerView.Display(level);
         Designer.Load(level);
         int rows = DesignerFileable.GetRowCount();
         int cols = DesignerFileable.GetColumnCount();
         BuildLevel(cols, rows, "Edit");
         DesignerView.UpdateLevel();
     }
     catch (ArgumentException e)
     {
         DesignerView.Display(e.Message);
     }
 }
        public void Load()
        {
            string[] newLevel = FilerView.Load();
            string   filename = newLevel[0];
            string   rawLevel = newLevel[1];

            Filer.SetString(rawLevel);
            string level = Filer.Load(filename);

            try
            {
                Game.Load(level);
                BuildView();
                //UpdateView();
                GameView.LevelName(filename);
            }
            catch (ArgumentOutOfRangeException e)
            {
                FilerView.Display(e);
            }
        }