Remove temporary solution "OptionSets" in favor of AutoWorld's Options

This commit is contained in:
Fabian Dill
2021-07-04 16:18:21 +02:00
parent 2530d28c9d
commit 7d5b20ccfc
13 changed files with 145 additions and 156 deletions

View File

@@ -1,4 +1,5 @@
import unittest
from argparse import Namespace
from BaseClasses import MultiWorld, CollectionState
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
@@ -8,14 +9,16 @@ from worlds.alttp.Items import ItemFactory
from worlds.alttp.Regions import create_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from Options import alttp_options
from worlds import AutoWorld
class TestDungeon(unittest.TestCase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.starting_regions = [] # Where to start exploring
self.remove_exits = [] # Block dungeon exits
self.world.difficulty_requirements[1] = difficulties['normal']

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_inverted_entrances
@@ -8,13 +10,16 @@ from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestInverted(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.difficulty_requirements[1] = difficulties['normal']
self.world.mode[1] = "inverted"
create_inverted_regions(self.world, 1)

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_inverted_entrances
@@ -8,13 +10,16 @@ from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestInvertedMinor(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.mode[1] = "inverted"
self.world.logic[1] = "minorglitches"
self.world.difficulty_requirements[1] = difficulties['normal']

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_inverted_entrances
@@ -8,14 +10,17 @@ from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestInvertedOWG(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.logic[1] = "owglitches"
self.world.mode[1] = "inverted"
self.world.difficulty_requirements[1] = difficulties['normal']

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_entrances
@@ -8,13 +10,16 @@ from worlds.alttp.Regions import create_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestMinor(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.logic[1] = "minorglitches"
self.world.difficulty_requirements[1] = difficulties['normal']
create_regions(self.world, 1)

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_entrances
@@ -8,14 +10,17 @@ from worlds.alttp.Regions import create_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestVanillaOWG(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.difficulty_requirements[1] = difficulties['normal']
self.world.logic[1] = "owglitches"
create_regions(self.world, 1)

View File

@@ -1,3 +1,5 @@
from argparse import Namespace
from BaseClasses import MultiWorld
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_entrances
@@ -8,13 +10,15 @@ from worlds.alttp.Regions import create_regions
from worlds.alttp.Shops import create_shops
from worlds.alttp.Rules import set_rules
from test.TestBase import TestBase
from Options import alttp_options
from worlds import AutoWorld
class TestVanilla(TestBase):
def setUp(self):
self.world = MultiWorld(1)
for option_name, option in alttp_options.items():
setattr(self.world, option_name, {1: option.default})
args = Namespace()
for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items():
setattr(args, name, {1: option.from_any(option.default)})
self.world.set_options(args)
self.world.logic[1] = "noglitches"
self.world.difficulty_requirements[1] = difficulties['normal']
create_regions(self.world, 1)