From 5e3a2492c7bb73daa4e27398daaf490d09980ff3 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 Jun 2022 17:41:59 -0400 Subject: Base system viewer with data loaded from csv files --- include/entitycomponents.hpp | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 include/entitycomponents.hpp (limited to 'include/entitycomponents.hpp') diff --git a/include/entitycomponents.hpp b/include/entitycomponents.hpp new file mode 100644 index 0000000..a263ebf --- /dev/null +++ b/include/entitycomponents.hpp @@ -0,0 +1,58 @@ +#ifndef ENTITY_COMPONENT_HPP +#define ENTITY_COMPONENT_HPP 1 + +#include "vex.hpp" +#include "units.hpp" +#include + +namespace ecs { +struct PositionComponent { + vex::vec2 position{}; +}; + +struct VelocityComponent { + vex::vec2 velocity{}; +}; + +struct MassComponent { + unit::Mass mass; +}; + +struct NameComponent { + std::string name; +}; + +struct OrbitalComponent { + unsigned origin; + long a; + double e; + double w; + double M; + double T; + double v; +}; + +struct RenderCircleComponent { + unsigned radius; +}; + +using component_variant = std::variant< + std::monostate, + PositionComponent, + VelocityComponent, + MassComponent, + NameComponent, + OrbitalComponent, + RenderCircleComponent +>; + +using component_sig = + std::bitset>; + +template +concept component_type = + is_variant_v; + +} + +#endif -- cgit v1.2.1