Esempio n. 1
0
        public static Dictionary<SoundName, SoundEffect> LoadSoundsForRegion(ContentManager contentManager, RegionNames region)
        {
            var soundDictionary = new Dictionary<SoundName, SoundEffect>();

            var sounds = RegionFactory.GetInfoForRegion(region).RegionSounds;

            foreach (var sound in sounds)
                soundDictionary.Add(sound, contentManager.Load<SoundEffect>(_soundFiles[sound]));

            return soundDictionary;
        }
Esempio n. 2
0
        public static List<SoundName> GetCrossRegionSoundEffects(List<RegionNames> regions)
        {
            var soundNames = new List<SoundName>();

            foreach (var region in regions)
            {
                var soundsToAdd = RegionFactory.GetInfoForRegion(region).CrossRegionSounds;

                foreach (var sound in soundsToAdd)
                {
                    if (!soundNames.Contains(sound))
                        soundNames.Add(sound);
                }
            }

            return soundNames;
        }
Esempio n. 3
0
        public static List <NpcNames> GetCrossRegionNpcsForRegions(List <RegionNames> regions)
        {
            var npcNames = new List <NpcNames>();

            foreach (var region in regions)
            {
                var npcsToAdd = RegionFactory.GetInfoForRegion(region).CrossRegionNpcs;

                foreach (var npc in npcsToAdd)
                {
                    if (!npcNames.Contains(npc))
                    {
                        npcNames.Add(npc);
                    }
                }
            }

            return(npcNames);
        }
Esempio n. 4
0
        // i think this is fine since the npc name is what defines the texture i suppose
        public static Dictionary <NpcNames, List <Texture2D> > LoadNpcsForRegion(ContentManager contentManager, RegionNames region)
        {
            var npcTextures = new Dictionary <NpcNames, List <Texture2D> >();
            var npcs        = RegionFactory.GetInfoForRegion(region).Npcs;

            foreach (var npc in npcs)
            {
                var fileNames = GetFileNamesFromType(npc);
                var textures  = new List <Texture2D>();

                foreach (var file in fileNames)
                {
                    textures.Add(contentManager.Load <Texture2D>(file));
                }

                npcTextures.Add(npc, textures);
            }

            return(npcTextures);
        }
Esempio n. 5
0
        public static Dictionary <SceneryNames, List <Texture2D> > LoadSceneryTextures(ContentManager contentManager, RegionNames region)
        {
            var textureDictionary = new Dictionary <SceneryNames, List <Texture2D> >();

            var sceneryToLoad = RegionFactory.GetInfoForRegion(region).Scenery;

            foreach (var item in sceneryToLoad)
            {
                var list      = new List <Texture2D>();
                var fileNames = _sceneryInfo[item].FileNames;

                foreach (var name in fileNames)
                {
                    list.Add(contentManager.Load <Texture2D>(name));
                }

                textureDictionary[item] = list;
            }

            return(textureDictionary);
        }