mirror of
https://github.com/ethanrusz/scouter.git
synced 2024-11-21 10:57:45 -05:00
Return None instead of empty list
This commit is contained in:
parent
9da4481750
commit
1a95687e59
1 changed files with 8 additions and 1 deletions
9
app.py
9
app.py
|
@ -32,9 +32,16 @@ def find_spawnlist(remaining_power: int, creatures: list[Creature]) -> list[str]
|
||||||
:param remaining_power: The remaining power in the current location.
|
:param remaining_power: The remaining power in the current location.
|
||||||
:return: A list of all creatures that may still spawn.
|
:return: A list of all creatures that may still spawn.
|
||||||
"""
|
"""
|
||||||
return sorted(
|
if remaining_power == 0:
|
||||||
|
return None
|
||||||
|
|
||||||
|
spawnable = sorted(
|
||||||
[creature.name for creature in creatures if creature.power <= remaining_power]
|
[creature.name for creature in creatures if creature.power <= remaining_power]
|
||||||
)
|
)
|
||||||
|
if spawnable != []:
|
||||||
|
return spawnable
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in a new issue