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

Component identifying an entity as an enemy with AI behavior. More...

#include <Enemy.hpp>

Inheritance diagram for ecs::Enemy:
Inheritance graph
Collaboration diagram for ecs::Enemy:
Collaboration graph

Public Member Functions

 Enemy (int enemyType, int scoreValue)
 Constructor with enemy parameters.
 
 ~Enemy () override=default
 
int getEnemyType () const
 Get enemy type.
 
int getScoreValue () const
 Get score value.
 
void setEnemyType (int enemyType)
 Set enemy type.
 
void setScoreValue (int scoreValue)
 Set score value.
 
ComponentType getType () const override
 Get the component type ID.
 
- Public Member Functions inherited from ecs::IComponent
virtual ~IComponent ()=default
 Virtual destructor.
 

Private Attributes

int _enemyType
 Enemy type/classification.
 
int _scoreValue
 Score points awarded on destruction.
 

Detailed Description

Component identifying an entity as an enemy with AI behavior.

Stores enemy-specific data including type classification, score value awarded on destruction, and attack pattern identifier for AI systems.

Definition at line 20 of file Enemy.hpp.

Constructor & Destructor Documentation

◆ Enemy()

ecs::Enemy::Enemy ( int  enemyType,
int  scoreValue 
)
inline

Constructor with enemy parameters.

Parameters
enemyTypeType/classification of enemy (e.g., 0=basic, 1=advanced)
scoreValuePoints awarded when destroyed

Definition at line 27 of file Enemy.hpp.

◆ ~Enemy()

ecs::Enemy::~Enemy ( )
overridedefault

Member Function Documentation

◆ getEnemyType()

int ecs::Enemy::getEnemyType ( ) const
inline

Get enemy type.

Returns
int Enemy classification type.

Definition at line 34 of file Enemy.hpp.

References _enemyType.

Referenced by Server::_serializeEntity().

◆ getScoreValue()

int ecs::Enemy::getScoreValue ( ) const
inline

Get score value.

Returns
int Points awarded on destruction.

Definition at line 40 of file Enemy.hpp.

References _scoreValue.

◆ getType()

ComponentType ecs::Enemy::getType ( ) const
inlineoverridevirtual

Get the component type ID.

Returns
ComponentType Unique ID for Enemy component.

Implements ecs::IComponent.

Definition at line 58 of file Enemy.hpp.

◆ setEnemyType()

void ecs::Enemy::setEnemyType ( int  enemyType)
inline

Set enemy type.

Parameters
enemyTypeNew enemy classification

Definition at line 46 of file Enemy.hpp.

References _enemyType.

◆ setScoreValue()

void ecs::Enemy::setScoreValue ( int  scoreValue)
inline

Set score value.

Parameters
scoreValueNew score value

Definition at line 52 of file Enemy.hpp.

References _scoreValue.

Member Data Documentation

◆ _enemyType

int ecs::Enemy::_enemyType
private

Enemy type/classification.

Definition at line 61 of file Enemy.hpp.

Referenced by getEnemyType(), and setEnemyType().

◆ _scoreValue

int ecs::Enemy::_scoreValue
private

Score points awarded on destruction.

Definition at line 62 of file Enemy.hpp.

Referenced by getScoreValue(), and setScoreValue().


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