From ea2d14256c0980783e8b1428ebbc851bd66c79d5 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Sat, 27 Jul 2024 05:25:31 -0600 Subject: [PATCH] Mods --- cromulant/ants.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cromulant/ants.py b/cromulant/ants.py index a1288d6..2838c0f 100644 --- a/cromulant/ants.py +++ b/cromulant/ants.py @@ -114,9 +114,7 @@ class Ants: Ants.populate(Config.default_population) @staticmethod - def hatch( - num: int = 1, on_change: bool = True, ignore: list[str] | None = None - ) -> None: + def hatch(num: int = 1, ignore: list[str] | None = None) -> None: from .game import Game for _ in range(num): @@ -125,13 +123,13 @@ class Ants: Ants.ants.append(ant) Game.update(ant) - if on_change: - Ants.on_change() + Ants.on_change() @staticmethod def on_change() -> None: from .game import Game + Ants.get_top() Game.info() Ants.save() @@ -183,7 +181,6 @@ class Ants: ant.method = method ant.updated = Utils.now() - Ants.get_top() Game.update(ant) Ants.on_change() @@ -306,9 +303,7 @@ class Ants: Ants.ants.append(ant) Game.update(ant) - Ants.hatch(on_change=False, ignore=[ant_1.name, ant_2.name]) - Ants.get_top() - Ants.on_change() + Ants.hatch(ignore=[ant_1.name, ant_2.name]) return True @staticmethod