Exemplo n.º 1
0
 public UsableItemsGenerator(IImagesStorage imagesStorage, IAncientSpellsProvider spellsProvider)
 {
     generators = new Dictionary <UsableItemType, IUsableItemTypeGenerator>
     {
         { UsableItemType.Potion, new PotionsGenerator() },
         { UsableItemType.Scroll, new ScrollsGenerator(spellsProvider) }
     };
 }
Exemplo n.º 2
0
        public ItemsGenerator(IItemGeneratorConfiguration configuration, IImagesStorage imagesStorage, IAncientSpellsProvider spellsProvider)
        {
            var bonusesGenerator = new BonusesGenerator(configuration.BonusesConfiguration);

            weaponGenerators = new Dictionary <WeaponType, IWeaponGenerator>
            {
                {
                    WeaponType.Sword,
                    new WeaponGenerator("Sword",
                                        WorldImageNameSword,
                                        configuration.WeaponsConfiguration.SwordsConfiguration,
                                        configuration.WeaponsConfiguration,
                                        bonusesGenerator,
                                        imagesStorage)
                },
                {
                    WeaponType.Dagger,
                    new WeaponGenerator("Dagger",
                                        WorldImageNameDagger,
                                        configuration.WeaponsConfiguration.DaggersConfiguration,
                                        configuration.WeaponsConfiguration,
                                        bonusesGenerator,
                                        imagesStorage)
                },
                {
                    WeaponType.Mace,
                    new WeaponGenerator("Mace",
                                        WorldImageNameMace,
                                        configuration.WeaponsConfiguration.MacesConfiguration,
                                        configuration.WeaponsConfiguration,
                                        bonusesGenerator,
                                        imagesStorage)
                },
                {
                    WeaponType.Axe,
                    new WeaponGenerator("Axe",
                                        WorldImageNameAxe,
                                        configuration.WeaponsConfiguration.AxesConfiguration,
                                        configuration.WeaponsConfiguration,
                                        bonusesGenerator,
                                        imagesStorage)
                },
                {
                    WeaponType.Staff,
                    new WeaponGenerator("Staff",
                                        WorldImageNameStaff,
                                        configuration.WeaponsConfiguration.StaffsConfiguration,
                                        configuration.WeaponsConfiguration,
                                        bonusesGenerator,
                                        imagesStorage)
                }
            };
            armorGenerator         = new ArmorGenerator(configuration.ArmorConfiguration, bonusesGenerator, imagesStorage);
            shieldGenerator        = new ShieldGenerator(configuration.ShieldsConfiguration, bonusesGenerator, imagesStorage);
            spellBookGenerator     = new SpellBookGenerator(configuration.SpellBooksConfiguration, bonusesGenerator, imagesStorage);
            usableItemsGenerator   = new UsableItemsGenerator(imagesStorage, spellsProvider);
            resourceItemsGenerator = new ResourceItemsGenerator();
            foodItemsGenerator     = new FoodItemsGenerator(imagesStorage);
        }
Exemplo n.º 3
0
 public ScrollsGenerator(IAncientSpellsProvider spellsProvider)
 {
     this.spellsProvider = spellsProvider;
     spellNamesCache     = new Dictionary <BookSpell, string>();
 }