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

Maximum number of distinct component types supported by the Registry. More...

Namespaces

namespace  CollisionLayers
 
namespace  wrapper
 

Classes

class  AISystem
 System managing enemy AI behavior and attack patterns. More...
 
class  Animation
 Component managing current animation playback state. More...
 
struct  AnimationClip
 Defines a sequence of frames for an animation. More...
 
class  AnimationSet
 Component containing all available animations for an entity. More...
 
class  AnimationSystem
 System managing sprite animation playback. More...
 
class  BoundarySystem
 System managing entity boundaries and screen limits. More...
 
class  Buff
 Component managing active buffs on an entity. More...
 
struct  BuffInstance
 Individual buff with its properties. More...
 
class  BuffSystem
 System managing buff timers and applying buff effects. More...
 
class  Collectible
 Component for items that can be picked up by players. More...
 
class  Collider
 Component for collision detection and physics interactions. More...
 
class  CollisionSystem
 System handling collision detection between entities. More...
 
class  Enemy
 Component identifying an entity as an enemy with AI behavior. More...
 
class  Health
 Component representing entity health and invincibility. More...
 
class  HealthSystem
 System managing entity health, invincibility and death. More...
 
class  IComponent
 Base interface for all ECS components. More...
 
class  ISystem
 Base interface for all ECS systems. More...
 
class  LuaScript
 Component that holds the path to a Lua script for entity behavior. More...
 
class  MapData
 Component storing information about the current map/level. More...
 
class  MapSystem
 System managing map state, scrolling, and transitions. More...
 
class  MovementSystem
 System handling entity movement based on velocity. More...
 
class  OrbitalModule
 Component for entities that orbit around a parent entity (like drones in Isaac). More...
 
class  OrbitalSystem
 System managing orbital module movement around parent entities. More...
 
class  PendingDestroy
 Marker component indicating entity should be destroyed. More...
 
class  Player
 Component identifying an entity as a player with game statistics. More...
 
class  PrefabFactory
 Factory for creating game entity prefabs. More...
 
class  Projectile
 Component for projectile entities (bullets, missiles, etc.). More...
 
struct  Rectangle
 Rectangle structure defining a region in a texture. More...
 
class  Registry
 Manages entities, their signatures and component type registrations. More...
 
class  Spawner
 Component that holds spawn requests to be processed by SpawnSystem. More...
 
struct  SpawnerConfig
 
struct  SpawnRequest
 Declarative request for spawning an entity. More...
 
class  SpawnSystem
 System managing entity spawning and wave generation. More...
 
class  Sprite
 Component representing a visual sprite from a texture. More...
 
class  Transform
 Component representing position, rotation and scale in 2D space. More...
 
class  Velocity
 Component representing movement direction and speed. More...
 
class  Wall
 Component for static or destructible walls/obstacles. More...
 
struct  WaveConfig
 
class  Weapon
 Component for entities capable of shooting projectiles. More...
 
class  WeaponSystem
 System managing weapon firing and cooldowns. More...
 

Typedefs

using ComponentType = std::size_t
 Type alias for component identification.
 
using Address = std::uint32_t
 Type used to represent an entity address/ID.
 
typedef std::bitset< N_MAX_COMPONENTSSignature
 Bitset representing the set of components attached to an entity.
 
using ComponentMask = std::uint64_t
 Type alias for component bitmask.
 

Enumerations

enum class  BuffType {
  SpeedBoost , DamageBoost , FireRateBoost , Shield ,
  HealthRegen , MultiShot , PiercingShot , HomingShot ,
  MaxHealthIncrease , DoubleShot , TripleShot
}
 Types of buffs that can be applied to entities. More...
 
enum class  CollectibleType { PowerUp , Upgrade , HealthPack , Score }
 Types of collectible items. More...
 
enum class  DestroyReason { OutOfBounds = 0 , Killed = 1 , Expired = 2 , Manual = 3 }
 Reason why an entity is being destroyed. More...
 

Functions

ComponentType getUniqueComponentType ()
 Generates a unique ID for each component type.
 
template<typename T >
ComponentType getComponentType ()
 Get the unique type ID for a specific component type.
 

Detailed Description

Maximum number of distinct component types supported by the Registry.

This value determines the size of the Signature bitset. Each registered component type is assigned a unique bit position in the Signature. Increased to 64 to match ComponentMask size and provide more flexibility.

Typedef Documentation

◆ Address

typedef uint32_t ecs::Address

Type used to represent an entity address/ID.

Addresses are 32-bit unsigned integers (non-zero).

Definition at line 37 of file PrefabFactory.hpp.

◆ ComponentMask

using ecs::ComponentMask = typedef std::uint64_t

Type alias for component bitmask.

Used to represent which components are required by a system. Each bit corresponds to a component type ID.

Note
Size matches Registry::Signature (N_MAX_COMPONENTS = 64 bits)

Definition at line 24 of file ISystem.hpp.

◆ ComponentType

using ecs::ComponentType = typedef std::size_t

Type alias for component identification.

Used to uniquely identify each component type in the ECS system.

Definition at line 19 of file IComponent.hpp.

◆ Signature

typedef std::bitset<N_MAX_COMPONENTS> ecs::Signature

Bitset representing the set of components attached to an entity.

Each bit corresponds to a component type; a set bit indicates the presence of that component on an entity. The number of bits is N_MAX_COMPONENTS.

Definition at line 45 of file Registry.hpp.

Enumeration Type Documentation

◆ BuffType

enum class ecs::BuffType
strong

Types of buffs that can be applied to entities.

Enumerator
SpeedBoost 

Increases movement speed.

DamageBoost 

Increases weapon damage.

FireRateBoost 

Increases fire rate.

Shield 

Temporary invincibility.

HealthRegen 

Regenerates health over time.

MultiShot 

Shoot in multiple directions.

PiercingShot 

Projectiles pierce through enemies.

HomingShot 

Projectiles home towards enemies.

MaxHealthIncrease 

Permanently increase max health.

DoubleShot 

Fire two projectiles at once.

TripleShot 

Fire three projectiles at once.

Definition at line 20 of file Buff.hpp.

◆ CollectibleType

enum class ecs::CollectibleType
strong

Types of collectible items.

Enumerator
PowerUp 

Temporary power-up (buffs)

Upgrade 

Permanent upgrade.

HealthPack 

Restores health.

Score 

Score bonus.

Definition at line 19 of file Collectible.hpp.

◆ DestroyReason

enum class ecs::DestroyReason
strong

Reason why an entity is being destroyed.

Enumerator
OutOfBounds 

Entity went outside screen boundaries.

Killed 

Entity was killed (health <= 0)

Expired 

Entity lifetime expired (e.g., projectile)

Manual 

Manually destroyed (script, etc.)

Definition at line 17 of file PendingDestroy.hpp.

Function Documentation

◆ getComponentType()

template<typename T >
ComponentType ecs::getComponentType ( )

Get the unique type ID for a specific component type.

Template function that returns a unique ID for each component type T. The same type will always return the same ID (singleton pattern).

Template Parameters
TThe component type (must inherit from IComponent).
Returns
ComponentType The unique ID for type T.
auto transformID = getComponentType<Transform>();
auto velocityID = getComponentType<Velocity>();
// transformID != velocityID

Definition at line 75 of file IComponent.hpp.

References getUniqueComponentType().

Here is the call graph for this function:

◆ getUniqueComponentType()

ComponentType ecs::getUniqueComponentType ( )
inline

Generates a unique ID for each component type.

This function uses a static counter to ensure each call returns a different ID. It's used internally by getComponentType<T>().

Returns
ComponentType A new unique component type ID.
Note
This function is thread-safe.

Definition at line 54 of file IComponent.hpp.

Referenced by getComponentType().