コード例 #1
0
ファイル: SoundsTests.cs プロジェクト: huuuskyyy/Teamworks
        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);
        }
コード例 #2
0
ファイル: SoundsTests.cs プロジェクト: huuuskyyy/Teamworks
        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();
        }
コード例 #3
0
ファイル: Engine.cs プロジェクト: huuuskyyy/Teamworks
        /// <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);
        }
コード例 #4
0
ファイル: Engine.cs プロジェクト: huuuskyyy/Teamworks
        /// <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;
        }