Source code for yendoria.systems.ai_behavior_interface
"""AI Behavior System Interface - Common interface for all AI behavior systems.This module defines the interface that all AI behavior systems must implement,ensuring consistency and interchangeability between different AI implementations."""fromabcimportABC,abstractmethodfromtypingimportAnyfromyendoria.components.ai_eventsimportAIEventfromyendoria.components.component_managerimportComponentManager
[docs]classAIBehaviorSystemInterface(ABC):""" Abstract base class for all AI behavior systems. This interface ensures that all AI behavior implementations provide the same basic functionality for integration with the AI Manager and Game Engine. """def__init__(self,component_manager:ComponentManager)->None:""" Initialize the AI behavior system. Args: component_manager: ECS component manager for entity/component access """self.component_manager=component_manager
[docs]@abstractmethoddefupdate(self,delta_time:float)->None:""" Update AI behavior for all managed entities. Args: delta_time: Time elapsed since last update in seconds """pass
[docs]@abstractmethoddefhandle_event(self,event:AIEvent)->None:""" Handle AI-related events that may affect behavior. Args: event: The AI event to process """pass
[docs]@abstractmethoddefget_performance_stats(self)->dict[str,Any]:""" Get performance statistics for monitoring and debugging. Returns: Dictionary containing performance metrics """pass
@property@abstractmethoddefname(self)->str:""" Get the name of this AI behavior system. Returns: Human-readable name of the system """pass
[docs]@abstractmethoddefshutdown(self)->None:""" Clean shutdown of the behavior system. Should release resources and clean up state. """pass