Esempio n. 1
0
        public void SoundsTestIfPositionChangedNullPathCanBeSet()
        {
            string pathToInvalidSelectionSound = "../../Sounds/Resources/invalid.wav";
            string pathToDetonatedBombSound = "../../Sounds/Resources/boom.wav";
            string pathToPositionChangedSound = null;

            Sounds player = new Sounds(pathToInvalidSelectionSound, pathToDetonatedBombSound, pathToPositionChangedSound);
        }
Esempio n. 2
0
        public void SoundsTestIfSelectionSoundIsFoundAtPath()
        {
            string pathToInvalidSelectionSound = "../../Sounds/Resources/not-valid.wav";
            string pathToDetonatedBombSound = "../../Sounds/Resources/boom.wav";
            string pathToPositionChangedSound = "../../Sounds/Resources/move.wav";

            Sounds player = new Sounds(pathToInvalidSelectionSound, pathToDetonatedBombSound, pathToPositionChangedSound);

            player.PlayInvalidSelection();
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        /// <summary>
        /// Get a new instance of a sound player.
        /// </summary>
        /// <returns>Return the new player.</returns>
        private Sounds GetNewSoundsPlayer()
        {
            string pathToInvalidMoveSound = "../../Sounds/Resources/invalid.wav";
            string pathToDetonatedBombSound = "../../Sounds/Resources/boom.wav";
            string pathToPositionChangedSound = "../../Sounds/Resources/move.wav";
            Sounds player = new Sounds(pathToInvalidMoveSound, pathToDetonatedBombSound, pathToPositionChangedSound);

            return player;
        }