示例#1
0
        public SoundManager(Game game)
            : base(game)
        {
            soundsList = new List<WavSound>();

            MainMenuVents = new WavSound(game, "mainMenuVents", true);
            MainMenuVents.SoundType = Sounds.MainMenuVents;
            soundsList.Add(MainMenuVents);
       
            MainMenuStairs = new WavSound(game, "mainMenuStairs", false);
            MainMenuStairs.SoundType = Sounds.MainMenuStairs;
            soundsList.Add(MainMenuStairs);

            MainMenuTimeGateWater = new WavSound(game, "mainMenuTimeGateWater", true);
            MainMenuTimeGateWater.SoundType = Sounds.MainMenuTimeGateWater;
            soundsList.Add(MainMenuTimeGateWater);

            MainMenuRoboticArms = new WavSound(game, "mainMenuRoboticArms", false);
            MainMenuRoboticArms.SoundType = Sounds.MainMenuRoboticArms;
            soundsList.Add(MainMenuRoboticArms);

            MainMenuPiston = new WavSound(game, "mainMenuPiston", false);
            MainMenuPiston.SoundType = Sounds.MainMenuPiston;
            soundsList.Add(MainMenuPiston);

            MainMenuCreditsPanelOpening = new WavSound(game, "mainMenuCreditsPanelOpening", false);
            MainMenuCreditsPanelOpening.SoundType = Sounds.MainMenuCreditsPanelOpening;
            soundsList.Add(MainMenuCreditsPanelOpening);

            MainMenuCreditsPanelClosing = new WavSound(game, "mainMenuCreditsPanelClosing", false);
            MainMenuCreditsPanelClosing.SoundType = Sounds.MainMenuCreditsPanelClosing;
            soundsList.Add(MainMenuCreditsPanelClosing);

            MainMenuSlot = new WavSound(game, "mainMenuSlot", false);
            MainMenuSlot.SoundType = Sounds.MainMenuSlot;
            soundsList.Add(MainMenuSlot);

            CommandCenterButton = new WavSound(game, "commandCenterButton", false);
            CommandCenterButton.SoundType = Sounds.CommandCenterButton;
            soundsList.Add(CommandCenterButton);

            CommandCenterZone = new WavSound(game, "commandCenterZone", false);
            CommandCenterZone.SoundType = Sounds.CommandCenterZone;
            soundsList.Add(CommandCenterZone);

            SlidingPanelLong = new WavSound(game, "slidingPanelLong", false);
            SlidingPanelLong.SoundType = Sounds.SlidingSoundLong;
            soundsList.Add(SlidingPanelLong);

            SlidingPanelShort= new WavSound(game, "slidingPanelShort", false);
            SlidingPanelShort.SoundType = Sounds.SlidingSoundShort;
            soundsList.Add(SlidingPanelShort);

            LeftMenuButtons = new WavSound(game, "LeftMenuButtons", false);
            LeftMenuButtons.SoundType = Sounds.LeftMenuButtons;
            soundsList.Add(LeftMenuButtons);

            EconomyFactory = new WavSound(game, "BuildingSounds\\EconomyFactory", false);
            EconomyFactory.SoundType = Sounds.EconomyFactory;
            soundsList.Add(EconomyFactory);

            EconomyMine = new WavSound(game, "BuildingSounds\\EconomyMine", false);
            EconomyMine.SoundType = Sounds.EconomyMine;
            soundsList.Add(EconomyMine);

            EconomyOilWell = new WavSound(game, "BuildingSounds\\EconomyOilWell", false);
            EconomyOilWell.SoundType = Sounds.EconomyOilWell;
            soundsList.Add(EconomyOilWell);

            EconomySawMill = new WavSound(game, "BuildingSounds\\EconomySawMill", false);
            EconomySawMill.SoundType = Sounds.EconomySawMill;
            soundsList.Add(EconomySawMill);

            Education = new WavSound(game, "BuildingSounds\\Education", false);
            Education.SoundType = Sounds.Education;
            soundsList.Add(Education);

            Energy = new WavSound(game, "BuildingSounds\\Energy", false);
            Energy.SoundType = Sounds.Energy;
            soundsList.Add(Energy);

            EnvironmentNursery = new WavSound(game, "BuildingSounds\\EnvironmentNursery", false);
            EnvironmentNursery.SoundType = Sounds.EnvironmentNursery;
            soundsList.Add(EnvironmentNursery);

            EnvironmentRecycling = new WavSound(game, "BuildingSounds\\EnvironmentRecycling", false);
            EnvironmentRecycling.SoundType = Sounds.EnvironmentRecycling;
            soundsList.Add(EnvironmentRecycling);

            EnvironmentWaterPurification = new WavSound(game, "BuildingSounds\\EnvironmentWaterPurification", false);
            EnvironmentWaterPurification.SoundType = Sounds.EnvironmentWaterPurification;
            soundsList.Add(EnvironmentWaterPurification);

            FoodAnimalFarm = new WavSound(game, "BuildingSounds\\FoodAnimalFarm", false);
            FoodAnimalFarm.SoundType = Sounds.FoodAnimalFarm;
            soundsList.Add(FoodAnimalFarm);

            FoodCropFarm = new WavSound(game, "BuildingSounds\\FoodCropFarm", false);
            FoodCropFarm.SoundType = Sounds.FoodCropFarm;
            soundsList.Add(FoodCropFarm);

            FoodFarmedFisherie = new WavSound(game, "BuildingSounds\\FoodFarmedFisherie", false);
            FoodFarmedFisherie.SoundType = Sounds.FoodFarmedFisherie;
            soundsList.Add(FoodFarmedFisherie);

            FoodOrchard = new WavSound(game, "BuildingSounds\\FoodOrchard", false);
            FoodOrchard.SoundType = Sounds.FoodOrchard;
            soundsList.Add(FoodOrchard);

            Health = new WavSound(game, "BuildingSounds\\Health", false);
            Health.SoundType = Sounds.Health;
            soundsList.Add(Health);

            Population = new WavSound(game, "BuildingSounds\\Population", false);
            Population.SoundType = Sounds.Population;
            soundsList.Add(Population);
                       
            UseDefaultSoundVolume = true;
            SetGeneralSoundVolume();

            tmrBackgroundStartPlayingDelay = new Timer(game);
            tmrBackgroundStartPlayingDelay.IntervalType = TimerIntervalType.Seconds;
            tmrBackgroundStartPlayingDelay.Interval = 3;//3 seconds
            tmrBackgroundStartPlayingDelay.OnTick +=new EventHandler(tmrBackgroundStartPlayingDelay_OnTick);
                     
            game.Components.Add(this);
            Game.Services.AddService(typeof(SoundManager), this);
        }
示例#2
0
        public SoundManager(Game game)
            : base(game)
        {
            soundsList = new List <WavSound>();

            MainMenuVents           = new WavSound(game, "mainMenuVents", true);
            MainMenuVents.SoundType = Sounds.MainMenuVents;
            soundsList.Add(MainMenuVents);

            MainMenuStairs           = new WavSound(game, "mainMenuStairs", false);
            MainMenuStairs.SoundType = Sounds.MainMenuStairs;
            soundsList.Add(MainMenuStairs);

            MainMenuTimeGateWater           = new WavSound(game, "mainMenuTimeGateWater", true);
            MainMenuTimeGateWater.SoundType = Sounds.MainMenuTimeGateWater;
            soundsList.Add(MainMenuTimeGateWater);

            MainMenuRoboticArms           = new WavSound(game, "mainMenuRoboticArms", false);
            MainMenuRoboticArms.SoundType = Sounds.MainMenuRoboticArms;
            soundsList.Add(MainMenuRoboticArms);

            MainMenuPiston           = new WavSound(game, "mainMenuPiston", false);
            MainMenuPiston.SoundType = Sounds.MainMenuPiston;
            soundsList.Add(MainMenuPiston);

            MainMenuCreditsPanelOpening           = new WavSound(game, "mainMenuCreditsPanelOpening", false);
            MainMenuCreditsPanelOpening.SoundType = Sounds.MainMenuCreditsPanelOpening;
            soundsList.Add(MainMenuCreditsPanelOpening);

            MainMenuCreditsPanelClosing           = new WavSound(game, "mainMenuCreditsPanelClosing", false);
            MainMenuCreditsPanelClosing.SoundType = Sounds.MainMenuCreditsPanelClosing;
            soundsList.Add(MainMenuCreditsPanelClosing);

            MainMenuSlot           = new WavSound(game, "mainMenuSlot", false);
            MainMenuSlot.SoundType = Sounds.MainMenuSlot;
            soundsList.Add(MainMenuSlot);

            CommandCenterButton           = new WavSound(game, "commandCenterButton", false);
            CommandCenterButton.SoundType = Sounds.CommandCenterButton;
            soundsList.Add(CommandCenterButton);

            CommandCenterZone           = new WavSound(game, "commandCenterZone", false);
            CommandCenterZone.SoundType = Sounds.CommandCenterZone;
            soundsList.Add(CommandCenterZone);

            SlidingPanelLong           = new WavSound(game, "slidingPanelLong", false);
            SlidingPanelLong.SoundType = Sounds.SlidingSoundLong;
            soundsList.Add(SlidingPanelLong);

            SlidingPanelShort           = new WavSound(game, "slidingPanelShort", false);
            SlidingPanelShort.SoundType = Sounds.SlidingSoundShort;
            soundsList.Add(SlidingPanelShort);

            LeftMenuButtons           = new WavSound(game, "LeftMenuButtons", false);
            LeftMenuButtons.SoundType = Sounds.LeftMenuButtons;
            soundsList.Add(LeftMenuButtons);

            EconomyFactory           = new WavSound(game, "BuildingSounds\\EconomyFactory", false);
            EconomyFactory.SoundType = Sounds.EconomyFactory;
            soundsList.Add(EconomyFactory);

            EconomyMine           = new WavSound(game, "BuildingSounds\\EconomyMine", false);
            EconomyMine.SoundType = Sounds.EconomyMine;
            soundsList.Add(EconomyMine);

            EconomyOilWell           = new WavSound(game, "BuildingSounds\\EconomyOilWell", false);
            EconomyOilWell.SoundType = Sounds.EconomyOilWell;
            soundsList.Add(EconomyOilWell);

            EconomySawMill           = new WavSound(game, "BuildingSounds\\EconomySawMill", false);
            EconomySawMill.SoundType = Sounds.EconomySawMill;
            soundsList.Add(EconomySawMill);

            Education           = new WavSound(game, "BuildingSounds\\Education", false);
            Education.SoundType = Sounds.Education;
            soundsList.Add(Education);

            Energy           = new WavSound(game, "BuildingSounds\\Energy", false);
            Energy.SoundType = Sounds.Energy;
            soundsList.Add(Energy);

            EnvironmentNursery           = new WavSound(game, "BuildingSounds\\EnvironmentNursery", false);
            EnvironmentNursery.SoundType = Sounds.EnvironmentNursery;
            soundsList.Add(EnvironmentNursery);

            EnvironmentRecycling           = new WavSound(game, "BuildingSounds\\EnvironmentRecycling", false);
            EnvironmentRecycling.SoundType = Sounds.EnvironmentRecycling;
            soundsList.Add(EnvironmentRecycling);

            EnvironmentWaterPurification           = new WavSound(game, "BuildingSounds\\EnvironmentWaterPurification", false);
            EnvironmentWaterPurification.SoundType = Sounds.EnvironmentWaterPurification;
            soundsList.Add(EnvironmentWaterPurification);

            FoodAnimalFarm           = new WavSound(game, "BuildingSounds\\FoodAnimalFarm", false);
            FoodAnimalFarm.SoundType = Sounds.FoodAnimalFarm;
            soundsList.Add(FoodAnimalFarm);

            FoodCropFarm           = new WavSound(game, "BuildingSounds\\FoodCropFarm", false);
            FoodCropFarm.SoundType = Sounds.FoodCropFarm;
            soundsList.Add(FoodCropFarm);

            FoodFarmedFisherie           = new WavSound(game, "BuildingSounds\\FoodFarmedFisherie", false);
            FoodFarmedFisherie.SoundType = Sounds.FoodFarmedFisherie;
            soundsList.Add(FoodFarmedFisherie);

            FoodOrchard           = new WavSound(game, "BuildingSounds\\FoodOrchard", false);
            FoodOrchard.SoundType = Sounds.FoodOrchard;
            soundsList.Add(FoodOrchard);

            Health           = new WavSound(game, "BuildingSounds\\Health", false);
            Health.SoundType = Sounds.Health;
            soundsList.Add(Health);

            Population           = new WavSound(game, "BuildingSounds\\Population", false);
            Population.SoundType = Sounds.Population;
            soundsList.Add(Population);

            UseDefaultSoundVolume = true;
            SetGeneralSoundVolume();

            tmrBackgroundStartPlayingDelay = new Timer(game);
            tmrBackgroundStartPlayingDelay.IntervalType = TimerIntervalType.Seconds;
            tmrBackgroundStartPlayingDelay.Interval     = 3;//3 seconds
            tmrBackgroundStartPlayingDelay.OnTick      += new EventHandler(tmrBackgroundStartPlayingDelay_OnTick);

            game.Components.Add(this);
            Game.Services.AddService(typeof(SoundManager), this);
        }