Core: convert mixture of Plando Options and Settings into just Options
This commit is contained in:
@@ -10,7 +10,7 @@ from rando.ItemLocContainer import ItemLocation
|
||||
# Holds settings not related to graph layout.
|
||||
class RandoSettings(object):
|
||||
def __init__(self, maxDiff, progSpeed, progDiff, qty, restrictions,
|
||||
superFun, runtimeLimit_s, plandoSettings, minDiff):
|
||||
superFun, runtimeLimit_s, PlandoOptions, minDiff):
|
||||
self.progSpeed = progSpeed.lower()
|
||||
self.progDiff = progDiff.lower()
|
||||
self.maxDiff = maxDiff
|
||||
@@ -20,7 +20,7 @@ class RandoSettings(object):
|
||||
self.runtimeLimit_s = runtimeLimit_s
|
||||
if self.runtimeLimit_s <= 0:
|
||||
self.runtimeLimit_s = sys.maxsize
|
||||
self.plandoSettings = plandoSettings
|
||||
self.PlandoOptions = PlandoOptions
|
||||
self.minDiff = minDiff
|
||||
|
||||
def getSuperFun(self):
|
||||
@@ -30,7 +30,7 @@ class RandoSettings(object):
|
||||
self.superFun = superFun[:]
|
||||
|
||||
def isPlandoRando(self):
|
||||
return self.plandoSettings is not None
|
||||
return self.PlandoOptions is not None
|
||||
|
||||
def getItemManager(self, smbm, nLocs):
|
||||
if not self.isPlandoRando():
|
||||
@@ -43,20 +43,20 @@ class RandoSettings(object):
|
||||
return None
|
||||
exclude = {'alreadyPlacedItems': defaultdict(int), 'forbiddenItems': []}
|
||||
# locsItems is a dict {'loc name': 'item type'}
|
||||
for locName,itemType in self.plandoSettings["locsItems"].items():
|
||||
for locName,itemType in self.PlandoOptions["locsItems"].items():
|
||||
if not any(loc.Name == locName for loc in locations):
|
||||
continue
|
||||
exclude['alreadyPlacedItems'][itemType] += 1
|
||||
exclude['alreadyPlacedItems']['total'] += 1
|
||||
|
||||
exclude['forbiddenItems'] = self.plandoSettings['forbiddenItems']
|
||||
exclude['forbiddenItems'] = self.PlandoOptions['forbiddenItems']
|
||||
|
||||
return exclude
|
||||
|
||||
def collectAlreadyPlacedItemLocations(self, container):
|
||||
if not self.isPlandoRando():
|
||||
return
|
||||
for locName,itemType in self.plandoSettings["locsItems"].items():
|
||||
for locName,itemType in self.PlandoOptions["locsItems"].items():
|
||||
if not any(loc.Name == locName for loc in container.unusedLocations):
|
||||
continue
|
||||
item = container.getNextItemInPool(itemType)
|
||||
|
||||
@@ -621,7 +621,7 @@ class VariaRandomizer:
|
||||
self.ctrlDict = { getattr(ctrl, button) : button for button in ctrlButton }
|
||||
args.moonWalk = ctrl.Moonwalk
|
||||
|
||||
plandoSettings = None
|
||||
PlandoOptions = None
|
||||
if args.plandoRando is not None:
|
||||
forceArg('progressionSpeed', 'speedrun', "'Progression Speed' forced to speedrun")
|
||||
progSpeed = 'speedrun'
|
||||
@@ -632,10 +632,10 @@ class VariaRandomizer:
|
||||
args.plandoRando = json.loads(args.plandoRando)
|
||||
RomPatches.ActivePatches[self.player] = args.plandoRando["patches"]
|
||||
DoorsManager.unserialize(args.plandoRando["doors"])
|
||||
plandoSettings = {"locsItems": args.plandoRando['locsItems'], "forbiddenItems": args.plandoRando['forbiddenItems']}
|
||||
PlandoOptions = {"locsItems": args.plandoRando['locsItems'], "forbiddenItems": args.plandoRando['forbiddenItems']}
|
||||
randoSettings = RandoSettings(self.maxDifficulty, progSpeed, progDiff, qty,
|
||||
restrictions, args.superFun, args.runtimeLimit_s,
|
||||
plandoSettings, minDifficulty)
|
||||
PlandoOptions, minDifficulty)
|
||||
|
||||
# print some parameters for jm's stats
|
||||
if args.jm == True:
|
||||
|
||||
Reference in New Issue
Block a user