Compare commits

..
1 Commits
Author SHA1 Message Date
Auric Vente 3c70f140dd first commit 2024-08-01 22:11:15 -06:00
5 changed files with 8 additions and 73 deletions
+1 -1
View File
@@ -181,8 +181,8 @@ class Ants:
ant.method = method ant.method = method
ant.updated = Utils.now() ant.updated = Utils.now()
Ants.on_change()
Game.update(ant) Game.update(ant)
Ants.on_change()
@staticmethod @staticmethod
def get() -> None: def get() -> None:
-12
View File
@@ -29,12 +29,6 @@ class Args:
score: bool = False score: bool = False
mono: bool = False mono: bool = False
fade: bool = True fade: bool = True
weight_merge: int = 1
weight_triumph: int = 2
weight_hit: int = 2
weight_travel: int = 2
weight_think: int = 2
weight_words: int = 4
@staticmethod @staticmethod
def prepare() -> None: def prepare() -> None:
@@ -68,12 +62,6 @@ class Args:
"argdoc", "argdoc",
"score", "score",
"mono", "mono",
"weight_merge",
"weight_triumph",
"weight_hit",
"weight_travel",
"weight_think",
"weight_words",
] ]
for n_item in normals: for n_item in normals:
-40
View File
@@ -43,10 +43,6 @@ class ArgSpec:
ArgSpec.infos = [] ArgSpec.infos = []
ArgSpec.add_arguments() ArgSpec.add_arguments()
@staticmethod
def weight_info(what: str) -> str:
return f"The weight of the '{what}' method. The greater this value, the higher its chances of being selected"
@staticmethod @staticmethod
def add_argument(key: str, info: str, **kwargs: Any) -> None: def add_argument(key: str, info: str, **kwargs: Any) -> None:
if key in ArgSpec.arguments: if key in ArgSpec.arguments:
@@ -188,39 +184,3 @@ class ArgSpec:
action="store_false", action="store_false",
info="Don't apply a fade-in effect on new updates", info="Don't apply a fade-in effect on new updates",
) )
ArgSpec.add_argument(
"weight_merge",
type=int,
info=ArgSpec.weight_info("merge"),
)
ArgSpec.add_argument(
"weight_triumph",
type=int,
info=ArgSpec.weight_info("triumph"),
)
ArgSpec.add_argument(
"weight_hit",
type=int,
info=ArgSpec.weight_info("hit"),
)
ArgSpec.add_argument(
"weight_travel",
type=int,
info=ArgSpec.weight_info("travel"),
)
ArgSpec.add_argument(
"weight_think",
type=int,
info=ArgSpec.weight_info("think"),
)
ArgSpec.add_argument(
"weight_words",
type=int,
info=ArgSpec.weight_info("words"),
)
+6 -19
View File
@@ -52,23 +52,12 @@ class Opt:
class Opts: class Opts:
merge: Opt merge = Opt(1, Method.merge)
triumph: Opt triumph = Opt(2, Method.triumph)
hit: Opt hit = Opt(2, Method.hit)
travel: Opt travel = Opt(2, Method.travel)
think: Opt think = Opt(2, Method.think)
words: Opt words = Opt(4, Method.words)
@staticmethod
def prepare() -> None:
from .args import Args
Opts.merge = Opt(Args.weight_merge, Method.merge)
Opts.triumph = Opt(Args.weight_triumph, Method.triumph)
Opts.hit = Opt(Args.weight_hit, Method.hit)
Opts.travel = Opt(Args.weight_travel, Method.travel)
Opts.think = Opt(Args.weight_think, Method.think)
Opts.words = Opt(Args.weight_words, Method.words)
@staticmethod @staticmethod
def opts_score() -> list[Opt]: def opts_score() -> list[Opt]:
@@ -97,7 +86,6 @@ class Game:
@staticmethod @staticmethod
def prepare() -> None: def prepare() -> None:
Opts.prepare()
Game.timer = QTimer() Game.timer = QTimer()
Game.timer.timeout.connect(Game.get_status) Game.timer.timeout.connect(Game.get_status)
@@ -460,7 +448,6 @@ class Game:
Game.started = False Game.started = False
Game.timer.stop() Game.timer.stop()
Game.merge_charge = 0
Window.clear_view() Window.clear_view()
Ants.populate(size) Ants.populate(size)
Window.to_top() Window.to_top()
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"version": "6.0.0", "version": "4.2.0",
"title": "Cromulant", "title": "Cromulant",
"program": "cromulant", "program": "cromulant",
"author": "madprops", "author": "madprops",