Spaces:
Runtime error
Runtime error
| """ | |
| 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.""" | |
| def add_player(self, player: Player) -> bool: | |
| """Add a player to the world.""" | |
| pass | |
| def remove_player(self, player_id: str) -> bool: | |
| """Remove a player from the world.""" | |
| pass | |
| def move_player(self, player_id: str, direction: str) -> bool: | |
| """Move a player in the specified direction.""" | |
| pass | |
| def get_player(self, player_id: str) -> Optional[Player]: | |
| """Get a player by ID.""" | |
| pass | |
| def get_all_players(self) -> Dict[str, Player]: | |
| """Get all players.""" | |
| pass | |
| 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 | |
| def get_world_state(self) -> Dict: | |
| """Get complete world state.""" | |
| pass | |
| class IGameEngine(ABC): | |
| """Interface for the main game engine.""" | |
| def start(self) -> bool: | |
| """Start the game engine.""" | |
| pass | |
| def stop(self) -> bool: | |
| """Stop the game engine.""" | |
| pass | |
| def get_world(self) -> IGameWorld: | |
| """Get the game world instance.""" | |
| pass | |
| def register_service(self, service_name: str, service: Any) -> bool: | |
| """Register a service with the engine.""" | |
| pass | |
| def get_service(self, service_name: str) -> Optional[Any]: | |
| """Get a registered service.""" | |
| pass | |