R-Type 0.1
Loading...
Searching...
No Matches
Shared gameplay

Gameplay components and systems used by both programs (src/Common). More...

Classes

struct  component::Bullet
 Marks an entity as a projectile. More...
 
struct  component::Controllable
 Marks an entity as a ship driven by player inputs. More...
 
struct  component::Enemy
 Marks an entity as a Bydos enemy. More...
 
struct  rtype::events::EnemyEscapedEvent
 Published when an enemy leaves the screen on the left side. More...
 
class  rtype::server::NetworkIdGenerator
 Process wide source of unique network entity ids, starting at 1000. More...
 
class  rtk::systems::BulletSystem
 Marks bullets that went past the right edge of the world as dead. More...
 
class  rtk::systems::EnemyGCSystem
 Removes enemies that left the screen on the left side. More...
 
struct  rtype::events::EnemySpawnedEvent
 Published by the server when a new enemy is spawned. More...
 
class  rtk::systems::EnemySpawnerSystem
 Spawns a Bydos enemy at a random position right of the screen every 1.5 seconds. More...
 

Functions

void component::bulletFromJson (rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &data)
 Adds a Bullet to an entity from its blueprint data.
 
void component::controllableFromJson (rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &data)
 Adds a Controllable to an entity from its blueprint data.
 
void component::enemyFromJson (rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &data)
 Adds an Enemy to an entity from its blueprint data.
 
void rtype::events::enemyEscapedEventFromJson (rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &data)
 Attaches an EnemyEscapedEvent to an entity from blueprint data.
 
void component::enemyEventFromJson (rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &data)
 Alias of rtype::events::enemyEscapedEventFromJson() for blueprints.
 

Detailed Description

Gameplay components and systems used by both programs (src/Common).

Function Documentation

◆ bulletFromJson()

void component::bulletFromJson ( rtk::ecs::Registry & reg,
std::size_t entity,
const nlohmann::json & data )
inline

Adds a Bullet to an entity from its blueprint data.

Parameters
regRegistry owning the entity.
entityTarget entity.
dataJSON object with an optional damage field.

◆ controllableFromJson()

void component::controllableFromJson ( rtk::ecs::Registry & reg,
std::size_t entity,
const nlohmann::json & data )
inline

Adds a Controllable to an entity from its blueprint data.

Parameters
regRegistry owning the entity.
entityTarget entity.
dataJSON object with optional speed and isChargingShoot fields.

◆ enemyFromJson()

void component::enemyFromJson ( rtk::ecs::Registry & reg,
std::size_t entity,
const nlohmann::json & data )
inline

Adds an Enemy to an entity from its blueprint data.

Parameters
regRegistry owning the entity.
entityTarget entity.
dataJSON object with an optional health field.

◆ enemyEscapedEventFromJson()

void rtype::events::enemyEscapedEventFromJson ( rtk::ecs::Registry & reg,
std::size_t entity,
const nlohmann::json & data )
inline

Attaches an EnemyEscapedEvent to an entity from blueprint data.

Parameters
regRegistry owning the entity.
entityTarget entity.
dataJSON object with an optional entityId field.

◆ enemyEventFromJson()

void component::enemyEventFromJson ( rtk::ecs::Registry & reg,
std::size_t entity,
const nlohmann::json & data )
inline

Alias of rtype::events::enemyEscapedEventFromJson() for blueprints.

Parameters
regRegistry owning the entity.
entityTarget entity.
dataJSON object with an optional entityId field.