Exemple #1
0
        /// <summary>
        /// Starts the game.
        /// </summary>
        /// <param name="isLoadGameChosen">Check if a load game is chosen.</param>
        private void Initialize(bool isLoadGameChosen)
        {
            this.gameSaver  = new SaveLoadAPI();
            this.gamePlayer = new Player("Pesho");

            if (isLoadGameChosen)
            {
                this.gameSaver.LoadGame();
                this.PlayField = this.InitializeField(this.gameSaver.MementoField.FieldDimension);
                this.PlayField.LoadMemento(this.gameSaver.MementoField);
            }
            else
            {
                this.PlayField = this.GetNewField();
            }

            this.CurrentCell  = this.PlayField[0, 0];
            this.SoundsPlayer = this.GetNewSoundsPlayer();
            this.Pointer      = new Pointer(this.playField[0, 0].X, this.playField[0, 0].Y);
        }
        public void SaveLoadApiLoadGameTest()
        {
            var saveLoadApi = new SaveLoadAPI();

            saveLoadApi.LoadGame();
        }