"""Mantimon TCG - Core Game Engine. This module contains the core game engine for Mantimon TCG, a highly configurable Pokemon TCG-inspired card game. The engine supports both campaign mode with fixed rules and free play mode with user-configurable rules. Key Components: - config: RulesConfig and sub-configs for all game rules - models: Data models for cards, game state, and actions - effects: Effect handler system for card abilities and attacks - engine: Main GameEngine orchestrator - turn_manager: Turn/phase state machine - rules_validator: Action legality checking - win_conditions: Win/loss detection - visibility: Hidden information filtering for clients - rng: Random number generation with testable seeded implementation Quick Start: from app.core import GameEngine, RulesConfig, create_rng # Create engine with rules and RNG engine = GameEngine(rules=RulesConfig(), rng=create_rng()) # Create a game game = engine.create_game( player_ids=["player1", "player2"], decks={"player1": deck1, "player2": deck2}, card_registry=registry, ) # Execute actions result = await engine.execute_action(game, "player1", action) # Get client-safe view visible = engine.get_visible_state(game, "player1") """ # Enums (foundational, no dependencies) # Configuration from app.core.config import ( ActiveConfig, BenchConfig, CombatConfig, DeckConfig, EnergyConfig, EvolutionConfig, FirstTurnConfig, PrizeConfig, RetreatConfig, RulesConfig, StatusConfig, TrainerConfig, WinConditionsConfig, ) # Engine from app.core.engine import ActionResult, GameEngine from app.core.enums import ( ActionType, CardType, EnergyType, GameEndReason, ModifierMode, PokemonStage, PokemonVariant, StatusCondition, TrainerType, TurnPhase, ) # Game state models (imported after config to avoid circular imports) from app.core.models.game_state import ( ForcedAction, GameState, PlayerState, Zone, ) # RNG from app.core.rng import RandomProvider, SecureRandom, SeededRandom, create_rng # Validation from app.core.rules_validator import ValidationResult, validate_action # Turn management from app.core.turn_manager import TurnManager, TurnStartResult # Visibility (for service layer) from app.core.visibility import ( VisibleGameState, VisiblePlayerState, VisibleZone, get_spectator_state, get_visible_state, ) # Win conditions from app.core.win_conditions import WinResult, check_win_conditions __all__ = [ # Enums "ActionType", "CardType", "EnergyType", "GameEndReason", "ModifierMode", "PokemonStage", "PokemonVariant", "StatusCondition", "TrainerType", "TurnPhase", # Configuration "RulesConfig", "DeckConfig", "ActiveConfig", "BenchConfig", "EnergyConfig", "PrizeConfig", "FirstTurnConfig", "WinConditionsConfig", "StatusConfig", "TrainerConfig", "EvolutionConfig", "RetreatConfig", "CombatConfig", # RNG "RandomProvider", "SeededRandom", "SecureRandom", "create_rng", # Engine "GameEngine", "ActionResult", # Validation "ValidationResult", "validate_action", # Win conditions "WinResult", "check_win_conditions", # Turn management "TurnManager", "TurnStartResult", # Visibility "VisibleGameState", "VisiblePlayerState", "VisibleZone", "get_visible_state", "get_spectator_state", # Game state models "ForcedAction", "GameState", "PlayerState", "Zone", ]