""" Core game interfaces for clean architecture. """ from abc import ABC, abstractmethod from typing import Dict, Any, Optional, List from ..core.player import Player class IGameWorld(ABC): """Interface for game world implementations.""" @abstractmethod def add_player(self, player: Player) -> bool: """Add a player to the world.""" pass @abstractmethod def remove_player(self, player_id: str) -> bool: """Remove a player from the world.""" pass @abstractmethod def move_player(self, player_id: str, direction: str) -> bool: """Move a player in the specified direction.""" pass @abstractmethod def get_player(self, player_id: str) -> Optional[Player]: """Get a player by ID.""" pass @abstractmethod def get_all_players(self) -> Dict[str, Player]: """Get all players.""" pass @abstractmethod def add_chat_message(self, sender: str, message: str, message_type: str = "public", target: str = None, sender_id: str = None): """Add a chat message.""" pass @abstractmethod def get_world_state(self) -> Dict: """Get complete world state.""" pass class IGameEngine(ABC): """Interface for the main game engine.""" @abstractmethod def start(self) -> bool: """Start the game engine.""" pass @abstractmethod def stop(self) -> bool: """Stop the game engine.""" pass @abstractmethod def get_world(self) -> IGameWorld: """Get the game world instance.""" pass @abstractmethod def register_service(self, service_name: str, service: Any) -> bool: """Register a service with the engine.""" pass @abstractmethod def get_service(self, service_name: str) -> Optional[Any]: """Get a registered service.""" pass