Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
it doubles as a smoke check that ``apply_action`` still behaves as intended.
"""

from __future__ import annotations

from functools import reduce

from mundane.engine.actions import Action, CastInstant, IllegalAction, PassPriority, PlayCard
Expand Down
2 changes: 0 additions & 2 deletions src/mundane/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
(create / get / save) makes swapping it for Redis or SQLite a localised change.
"""

from __future__ import annotations

from typing import Any
from uuid import uuid4

Expand Down
2 changes: 0 additions & 2 deletions src/mundane/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
is pure translation.
"""

from __future__ import annotations

from typing import TYPE_CHECKING

from mundane.engine.actions import CastInstant, IllegalAction, PassPriority, PlayCard
Expand Down
4 changes: 1 addition & 3 deletions src/mundane/engine/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from it so the wire format can never drift from the engine.
"""

from __future__ import annotations

from dataclasses import dataclass


Expand Down Expand Up @@ -39,7 +37,7 @@ class PassPriority:
"""The closed set of moves a player may submit."""


ACTION_TYPES: dict[str, type[PlayCard | CastInstant | PassPriority]] = {
ACTION_TYPES: dict[str, type[Action]] = {
"play_card": PlayCard,
"cast_instant": CastInstant,
"pass_priority": PassPriority,
Expand Down
2 changes: 0 additions & 2 deletions src/mundane/engine/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
through :data:`CARD_LIBRARY` is how the engine recovers a card's type, cost, and effect.
"""

from __future__ import annotations

from .state import Card, CardType, GameState, StackItem


Expand Down
2 changes: 0 additions & 2 deletions src/mundane/engine/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
is never logged.
"""

from __future__ import annotations

from dataclasses import dataclass, field
from typing import TYPE_CHECKING

Expand Down
2 changes: 0 additions & 2 deletions src/mundane/engine/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
``final = reduce(apply_action, actions, initial)``.
"""

from __future__ import annotations

from .actions import Action, CastInstant, IllegalAction, PassPriority, PlayCard
from .cards import CARD_LIBRARY
from .state import PERMANENTS, PHASES, CardType, GameState, StackItem
Expand Down
2 changes: 0 additions & 2 deletions src/mundane/engine/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
hand-written decoder.
"""

from __future__ import annotations

import dataclasses
import json
from enum import Enum
Expand Down
6 changes: 2 additions & 4 deletions src/mundane/engine/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
:class:`GameState` round-trip through JSON.
"""

from __future__ import annotations

from collections.abc import Callable
from dataclasses import dataclass, field
from enum import Enum
from enum import StrEnum


class CardType(Enum):
class CardType(StrEnum):
"""The five kinds of card. The first three are permanents (they stay on the board)."""

PERSON = "person" # creature-like; stays on the board once it resolves
Expand Down
2 changes: 0 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""API tests: drive the Litestar app over HTTP and confirm it is a thin shell over the engine."""

from __future__ import annotations

from typing import TYPE_CHECKING

import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/test_replay.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Replay tests: a game's state is a pure fold of its action log (the event-sourcing property)."""

from __future__ import annotations

from functools import reduce

import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/test_rules.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Engine rules tests: the legality preconditions mirrored one-for-one, plus the countered party."""

from __future__ import annotations

import dataclasses
import json
from copy import deepcopy
Expand Down