From a3e06b7f1908da9bd2c4bc0f3b566cc363dbcb34 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Thu, 25 Jul 2024 08:36:15 -0600 Subject: [PATCH] Mods --- cromulant/game.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/cromulant/game.py b/cromulant/game.py index 0904ef0..5c6f961 100644 --- a/cromulant/game.py +++ b/cromulant/game.py @@ -1,7 +1,6 @@ from __future__ import annotations import random -from dataclasses import dataclass from PySide6.QtWidgets import QHBoxLayout # type: ignore from PySide6.QtWidgets import QVBoxLayout @@ -35,24 +34,28 @@ class Method: words = "words" -@dataclass class Opt: - value: int - weight: int - method: str + value = 0 + + def __init__(self, weight: int, method: str) -> None: + self.value = Opt.value + self.weight = weight + self.method = method + + Opt.value += 1 class Opts: - merge = Opt(0, 1, Method.merge) - triumph = Opt(1, 2, Method.triumph) - hit = Opt(2, 2, Method.hit) - travel = Opt(3, 2, Method.travel) - think_1 = Opt(4, 2, Method.think) - think_2 = Opt(5, 2, Method.think) - words_1 = Opt(6, 3, Method.words) - words_2 = Opt(7, 3, Method.words) - words_3 = Opt(8, 3, Method.words) - words_4 = Opt(9, 3, Method.words) + merge = Opt(1, Method.merge) + triumph = Opt(2, Method.triumph) + hit = Opt(2, Method.hit) + travel = Opt(2, Method.travel) + think_1 = Opt(2, Method.think) + think_2 = Opt(2, Method.think) + words_1 = Opt(3, Method.words) + words_2 = Opt(3, Method.words) + words_3 = Opt(3, Method.words) + words_4 = Opt(3, Method.words) @staticmethod def opts_score() -> list[Opt]: