""" Service layer interfaces for clean architecture. """ from abc import ABC, abstractmethod from typing import Dict, Any, Optional, List, Tuple from ..core.player import Player class IPlayerService(ABC): """Interface for player management service.""" @abstractmethod def create_player(self, name: str, player_type: str) -> Player: """Create a new player.""" pass @abstractmethod def get_player(self, player_id: str) -> Optional[Player]: """Get player by ID.""" pass @abstractmethod def update_player(self, player: Player) -> bool: """Update player data.""" pass @abstractmethod def move_player(self, player_id: str, direction: str) -> bool: """Move player in specified direction.""" pass @abstractmethod def level_up_player(self, player_id: str) -> bool: """Level up a player.""" pass class IChatService(ABC): """Interface for chat management service.""" @abstractmethod def send_public_message(self, sender_id: str, message: str) -> bool: """Send public chat message.""" pass @abstractmethod def send_private_message(self, sender_id: str, target_id: str, message: str) -> Tuple[bool, str]: """Send private message.""" pass @abstractmethod def get_chat_history(self, limit: int = None) -> List[Dict]: """Get chat history.""" pass @abstractmethod def add_system_message(self, message: str) -> bool: """Add system message.""" pass class INPCService(ABC): """Interface for NPC management service.""" @abstractmethod def get_npc_response(self, npc_id: str, message: str, player_id: str = None) -> str: """Get NPC response to player message.""" pass @abstractmethod def register_npc(self, npc_id: str, npc_data: Dict) -> bool: """Register a new NPC.""" pass @abstractmethod def get_npc(self, npc_id: str) -> Optional[Dict]: """Get NPC data.""" pass @abstractmethod def update_npc_position(self, npc_id: str, x: int, y: int) -> bool: """Update NPC position.""" pass class IMCPService(ABC): """Interface for MCP integration service.""" @abstractmethod def register_ai_agent(self, agent_id: str, name: str, agent_type: str = "ai_agent") -> str: """Register AI agent via MCP.""" pass @abstractmethod def move_agent(self, agent_id: str, direction: str) -> Dict: """Move AI agent.""" pass @abstractmethod def send_chat(self, agent_id: str, message: str) -> Dict: """Send chat message from AI agent.""" pass @abstractmethod def get_game_state(self) -> Dict: """Get current game state.""" pass class IPluginService(ABC): """Interface for plugin management service.""" @abstractmethod def load_plugins(self) -> int: """Load all plugins from plugins directory.""" pass @abstractmethod def load_plugin(self, plugin_path: str) -> bool: """Load a specific plugin.""" pass @abstractmethod def unload_plugin(self, plugin_id: str) -> bool: """Unload a plugin.""" pass @abstractmethod def get_loaded_plugins(self) -> List[str]: """Get list of loaded plugin IDs.""" pass @abstractmethod def reload_plugin(self, plugin_id: str) -> bool: """Reload a plugin (hot-reload).""" pass