R-Type 0.1
Loading...
Searching...
No Matches
Dead.hpp
1#pragma once
2
3#include <cstdint>
4#include <nlohmann/json.hpp>
5
6#include <Registry.hpp>
7
8namespace component {
17struct Dead {};
18
24inline void deadFromJson(rtk::ecs::Registry &reg, std::size_t entity,
25 const nlohmann::json & /*data*/) {
26 component::Dead dead{};
27
28 reg.get_components<component::Dead>().insert_at(entity, dead);
29}
30
32} // namespace component
void deadFromJson(rtk::ecs::Registry &reg, std::size_t entity, const nlohmann::json &)
Adds a Dead tag to an entity from its blueprint data.
Definition Dead.hpp:24
Tag marking an entity for destruction at the end of the frame.
Definition Dead.hpp:17