R-Type 0.1
Loading...
Searching...
No Matches
rtype::server::ServerDeathSystem Class Referencefinal

Destroys dead entities and tells every player with DestroyEntity. More...

#include <ServerDeathSystem.hpp>

Inheritance diagram for rtype::server::ServerDeathSystem:
[legend]

Public Member Functions

 ServerDeathSystem (Server &server, const std::unordered_map< std::uint32_t, std::size_t > &players, const std::uint32_t &serverTick)
 Creates the system.
 
void onStart (rtk::ecs::Registry &) override
 Does nothing.
 
void update (rtk::ecs::Registry &reg, float) override
 Broadcasts and destroys every entity tagged with Dead.
 
void onStop (rtk::ecs::Registry &) override
 Does nothing.
 

Detailed Description

Destroys dead entities and tells every player with DestroyEntity.

Constructor & Destructor Documentation

◆ ServerDeathSystem()

rtype::server::ServerDeathSystem::ServerDeathSystem ( Server & server,
const std::unordered_map< std::uint32_t, std::size_t > & players,
const std::uint32_t & serverTick )
inline

Creates the system.

Parameters
serverServer used to send DestroyEntity.
playersConnected players, keyed by connection id.
serverTickCurrent server tick.

Member Function Documentation

◆ update()

void rtype::server::ServerDeathSystem::update ( rtk::ecs::Registry & reg,
float  )
inlineoverride

Broadcasts and destroys every entity tagged with Dead.

Parameters
regRegistry holding the entities.