AIControllerComponent Class
Definition¶
Namespace: Brine2D.Systems.AI
Component for AI-controlled entities. Supports multiple AI behaviors (patrol, chase, flee, wander). Lives in Brine2D.ECS because it's pure game logic (no external dependencies).
public class AIControllerComponent : Brine2D.ECS.Component
Inheritance System.Object → Component → AIControllerComponent
| Properties | |
|---|---|
| Behavior | Current AI behavior mode. |
| CurrentTarget | Current target entity (set by AISystem). |
| CurrentWaypointIndex | Current patrol waypoint index. |
| DetectionRange | Detection range for chase/flee behaviors (in units). |
| DistanceToTarget | Current distance to target (calculated by AISystem). |
| HasTarget | Whether the AI has a target in range. |
| LoopPatrol | Whether to loop patrol points (true) or ping-pong (false). |
| MoveDirection | Current movement direction (calculated by AISystem). |
| MoveSpeed | Movement speed in units per second. |
| PatrolPoints | Patrol waypoints (for patrol behavior). |
| SpawnPosition | Spawn position (used for wander radius). |
| StopDistance | Whether to stop when target is within this distance (for chase). 0 = always chase. |
| TargetTag | Tag of entities to track (e.g., "Player" for enemies). |
| WanderChangeInterval | Time between direction changes when wandering (seconds). |
| WanderRadius | Maximum wander distance from spawn point. |
| WanderTimer | Timer for wander behavior. |
| WaypointReachedDistance | Distance to waypoint before moving to next one. |