mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Doc, SoE: Logic mixin: no underscore for public members (#1049)
* Doc: logic mixin, drop underscore, clarify conventionally, we added a leading underscore to logic mixins' function names. This is noisy in the warning section of IDEs. Leading underscores should only be used for private/protected functions. In addition, the use of self.world and/or requirement to (no) pass in stuff was not made clear earlier. * SoE: fix _ warnings for logic mixin
This commit is contained in:
@@ -283,7 +283,7 @@ class SoEWorld(World):
|
||||
self.world.completion_condition[self.player] = lambda state: state.has('Victory', self.player)
|
||||
# set Done from goal option once we have multiple goals
|
||||
set_rule(self.world.get_location('Done', self.player),
|
||||
lambda state: state._soe_has(pyevermizer.P_FINAL_BOSS, self.world, self.player))
|
||||
lambda state: state.soe_has(pyevermizer.P_FINAL_BOSS, self.world, self.player))
|
||||
set_rule(self.world.get_entrance('New Game', self.player), lambda state: True)
|
||||
for loc in _locations:
|
||||
location = self.world.get_location(loc.name, self.player)
|
||||
@@ -292,7 +292,7 @@ class SoEWorld(World):
|
||||
def make_rule(self, requires: typing.List[typing.Tuple[int]]) -> typing.Callable[[typing.Any], bool]:
|
||||
def rule(state) -> bool:
|
||||
for count, progress in requires:
|
||||
if not state._soe_has(progress, self.world, self.player, count):
|
||||
if not state.soe_has(progress, self.world, self.player, count):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
Reference in New Issue
Block a user