示例#1
0
        public static ItemLocationMap Randomize(Seed seed, FillingMethod fillingMethod, GameSave saveGame, bool progressionOnly = false)
        {
            var unlockingMap     = new ItemUnlockingMap(seed);
            var itemInfoProvider = new ItemInfoProvider(seed.Options, unlockingMap);

            ItemLocationRandomizer randomizer;

            switch (fillingMethod)
            {
            case FillingMethod.Forward:
                randomizer = new ForwardFillingItemLocationRandomizer(seed, itemInfoProvider, unlockingMap);
                break;

            case FillingMethod.Random:
                randomizer = new FullRandomItemLocationRandomizer(seed, itemInfoProvider, unlockingMap);
                break;

            case FillingMethod.Archipelago:
                randomizer = new ArchipelagoItemLocationRandomizer(seed, itemInfoProvider, unlockingMap, saveGame);
                break;

            default:
                throw new NotImplementedException($"filling method {fillingMethod} is not implemented");
            }

            return(randomizer.GenerateItemLocationMap(progressionOnly));
        }
        public void Should_fill_tuturial_with_melee_and_spellorb(uint seedIndex)
        {
            var seed          = new Seed(seedIndex, SeedOptions.None);
            var unlockingMap  = new ItemUnlockingMap(seed);
            var itemProvider  = new ItemInfoProvider(SeedOptions.None, unlockingMap);
            var itemLocations = new ItemLocationMap(itemProvider, unlockingMap, SeedOptions.None);

            FullRandomItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemProvider, unlockingMap, itemLocations, true);

            Assert.That(itemLocations[ItemKey.TutorialMeleeOrb].ItemInfo.Identifier.LootType, Is.EqualTo(LootType.Orb));
            Assert.That(itemLocations[ItemKey.TutorialMeleeOrb].ItemInfo.Identifier.OrbSlot, Is.EqualTo(EOrbSlot.Melee));

            Assert.That(itemLocations[ItemKey.TutorialSpellOrb].ItemInfo.Identifier.LootType, Is.EqualTo(LootType.Orb));
            Assert.That(itemLocations[ItemKey.TutorialSpellOrb].ItemInfo.Identifier.OrbSlot, Is.EqualTo(EOrbSlot.Spell));
        }
示例#3
0
        public static ItemLocationMap Randomize(Seed seed, FillingMethod fillingMethod, bool progressionOnly = false)
        {
            var unlockingMap     = new ItemUnlockingMap(seed);
            var itemInfoProvider = new ItemInfoProvider(seed.Options, unlockingMap);
            var itemLocations    = new ItemLocationMap(itemInfoProvider, unlockingMap, seed.Options);

            switch (fillingMethod)
            {
            case FillingMethod.Forward:
                ForwardFillingItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemInfoProvider, unlockingMap, itemLocations, progressionOnly);
                break;

            case FillingMethod.Random:
                FullRandomItemLocationRandomizer.AddRandomItemsToLocationMap(seed, itemInfoProvider, unlockingMap, itemLocations, progressionOnly);
                break;

            default:
                throw new NotImplementedException($"filling method {fillingMethod} is not implemented");
            }

            return(itemLocations);
        }