Пример #1
0
        /// <summary>
        /// Strong Construction. Start a 'Normal' game
        /// <see cref="Init"/>, then <see cref="InitFX"/>, then <see cref="StartRender"/>
        /// </summary>
        /// <param name="aMap">Puzzle to play</param>
        public GameUI(Puzzle aPuzzle, PuzzleMap aMap, ISoundSubSystem sfx)
            : base(aPuzzle, aMap.Map)
        {
            solution = null;
            puzzleMap = aMap;

            initType = InitTypes.NewGame;

            GameCoords = new GameCoords(this);
            StepCurrent = 0;

            ResourceManager = ResourceFactory.Singleton.GetInstance("Default.GameTiles");
            GameCoords.GlobalTileSize = new SizeInt(32, 32);

            nodes = new List<NodeBase>();
            nodesToRemove = new List<NodeBase>();
            nodesToAdd = new List<NodeBase>();

            // I would like to move this somewhere else
            sound = sfx;
            sfxWelcome = sound.GetHandle("Welcome.wav");
            sfxUndo = sound.GetHandle("sound40.wav");
            sfxRestart = sound.GetHandle("sound31.wav");

            // Add blank bookmarks
            Add((Bookmark)null);
            Add((Bookmark)null);
            Add((Bookmark)null);
            Add((Bookmark)null);
            Add((Bookmark)null);
        }
        /// <summary>
        /// Play a sound
        /// </summary>
        /// <param name="sound"></param>
        public void PlaySound(ISoundHandle sound)
        {
            if (sound == null) return;

            SoundFX sfx = sound as SoundFX;
            if (sfx != null)
            {
                sfx.Play();
            }
        }
 /// <summary>
 /// Play music
 /// </summary>
 /// <param name="music"></param>
 public void PlayMusic(ISoundHandle music)
 {
     SoundMusic msc = music as SoundMusic;
     if (msc != null)
     {
         player.Play(msc.Res);
     }
 }
        public void PlayMusic(ISoundHandle music)
        {
            if (music == null) return;

            try
            {
                player.Open(music.ToString());
                player.Play();
                currentMusic = music;

                string states = player.PlayState.ToString();
            }
            catch(Exception ex)
            {
                throw new Exception("Cannot play music file: " + music.ToString(), ex);
            }
        }
Пример #5
0
 public void PlaySound(ISoundHandle sound)
 {
 }
Пример #6
0
 public void PlayMusic(ISoundHandle music)
 {
 }