R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
ecs::AISystem Class Reference

System managing enemy AI behavior and attack patterns. More...

#include <AISystem.hpp>

Inheritance diagram for ecs::AISystem:
Inheritance graph
Collaboration diagram for ecs::AISystem:
Collaboration graph

Public Member Functions

 AISystem ()=default
 Default constructor.
 
 ~AISystem () override=default
 Default destructor.
 
void update (Registry &registry, float deltaTime) override
 Updates all enemy AI behaviors.
 
ComponentMask getComponentMask () const override
 Gets the component mask for this system.
 
- Public Member Functions inherited from ecs::ISystem
virtual ~ISystem ()=default
 Virtual destructor.
 

Private Member Functions

void applyMovementPattern (const Enemy &enemy, Transform &transform, Velocity &velocity, float deltaTime)
 Applies movement pattern to an enemy entity.
 

Detailed Description

System managing enemy AI behavior and attack patterns.

Controls enemy movement patterns and attack behaviors. Requires Enemy, Transform and Velocity components.

Definition at line 23 of file AISystem.hpp.

Constructor & Destructor Documentation

◆ AISystem()

ecs::AISystem::AISystem ( )
default

Default constructor.

◆ ~AISystem()

ecs::AISystem::~AISystem ( )
overridedefault

Default destructor.

Member Function Documentation

◆ applyMovementPattern()

void ecs::AISystem::applyMovementPattern ( const Enemy enemy,
Transform transform,
Velocity velocity,
float  deltaTime 
)
private

Applies movement pattern to an enemy entity.

Applies specific movement patterns based on enemy type.

Parameters
enemyEnemy component containing pattern information
transformTransform component for position data
velocityVelocity component to modify
deltaTimeTime elapsed since last frame (in seconds)

Definition at line 38 of file AISystem.cpp.

Referenced by update().

◆ getComponentMask()

ComponentMask ecs::AISystem::getComponentMask ( ) const
overridevirtual

Gets the component mask for this system.

Returns
ComponentMask requiring Enemy, Transform and Velocity components

Implements ecs::ISystem.

Definition at line 45 of file AISystem.cpp.

Referenced by update().

◆ update()

void ecs::AISystem::update ( Registry registry,
float  deltaTime 
)
overridevirtual

Updates all enemy AI behaviors.

Updates all enemy AI behaviors for the current frame.

Processes each enemy entity and applies movement patterns based on their attack pattern type.

Parameters
registryReference to the ECS registry
deltaTimeTime elapsed since last frame (in seconds)

Implements ecs::ISystem.

Definition at line 17 of file AISystem.cpp.

References applyMovementPattern(), ecs::Registry::getComponent(), getComponentMask(), ecs::Registry::getEntitiesWithMask(), ecs::Registry::hasComponent(), and ecs::Weapon::setShouldShoot().

Here is the call graph for this function:

The documentation for this class was generated from the following files: