From d72d21a00f583cdc98b89f65f8d379e4a28c3399 Mon Sep 17 00:00:00 2001 From: Ethan Ruszanowski Date: Thu, 22 Feb 2024 21:35:38 -0500 Subject: [PATCH] Refactor names --- app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 58700e2..f34b1c0 100644 --- a/app.py +++ b/app.py @@ -25,10 +25,11 @@ class Run: self.outside_power = moon.outside_max_power -def find_spawnlist(remaining_power: int, creatures: list[Creature]) -> list[str] | None: +def find_spawn_list(remaining_power: int, creatures: list[Creature]) -> list[str] | None: """ Given a run, return all possible spawns for location. + :param creatures: :param remaining_power: The remaining power in the current location. :return: A list of all creatures that may still spawn or None. """ @@ -38,7 +39,7 @@ def find_spawnlist(remaining_power: int, creatures: list[Creature]) -> list[str] spawnable = sorted( [creature.name for creature in creatures if creature.power <= remaining_power] ) - if spawnable != []: + if spawnable: return spawnable else: return None @@ -138,7 +139,7 @@ def main(): st.info(f"Maximum power: {run.moon.outside_max_power}") if run.outside_power >= 0: st.warning(f"🌳 Outside power remaining: {run.outside_power}") - st.write(find_spawnlist(run.outside_power, outside_creatures)) + st.write(find_spawn_list(run.outside_power, outside_creatures)) else: st.error( f"Power level exceeds maximum possible for {run.moon.name}." @@ -177,7 +178,7 @@ def main(): st.info(f"Maximum power: {run.moon.inside_max_power}") if run.inside_power >= 0: st.warning(f"🏭 Inside power remaining: {run.inside_power}") - st.write(find_spawnlist(run.inside_power, inside_creatures)) + st.write(find_spawn_list(run.inside_power, inside_creatures)) else: st.error( f"Power level exceeds maximum possible for {run.moon.name}."