PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
kill_volume_component.h
1#pragma once
2
3#include "pixelbullet/serialization/node.h"
4
5namespace pixelbullet
6{
8{
9 bool enabled = true;
10
11 [[nodiscard]] bool operator==(const KillVolumeComponent&) const noexcept = default;
12};
13
14inline Node& operator<<(Node& node, const KillVolumeComponent& component)
15{
16 node["enabled"] << component.enabled;
17 return node;
18}
19
20inline const Node& operator>>(const Node& node, KillVolumeComponent& component)
21{
22 if (node.HasProperty("enabled"))
23 {
24 node["enabled"] >> component.enabled;
25 }
26 else
27 {
28 component.enabled = true;
29 }
30
31 return node;
32}
33} // namespace pixelbullet
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:45
Definition kill_volume_component.h:8