From 96c678e5fc141df2440e8000d47dcf5cb942cd7c Mon Sep 17 00:00:00 2001 From: "C. J. Howard" Date: Wed, 5 Oct 2022 21:36:55 +0800 Subject: [PATCH] Move game-related components and systems out of entity namespace and into game namespace --- CMakeLists.txt | 1 - src/color/cct.hpp | 2 +- src/entity/commands.cpp | 68 ++++++------ src/entity/ebt.cpp | 4 +- src/game/ant/swarm.cpp | 26 ++--- .../component}/atmosphere.hpp | 10 +- .../component}/behavior.hpp | 12 +- .../component}/blackbody.hpp | 10 +- .../components => game/component}/brush.hpp | 10 +- .../components => game/component}/camera.hpp | 10 +- .../components => game/component}/cavity.hpp | 10 +- .../component}/celestial-body.hpp | 10 +- .../components => game/component}/chamber.hpp | 10 +- .../component}/collision.hpp | 10 +- .../component}/constraint-stack.hpp | 18 +-- .../component}/constraints/constraints.hpp | 10 +- .../component}/constraints/copy-rotation.hpp | 10 +- .../component}/constraints/copy-scale.hpp | 10 +- .../component}/constraints/copy-transform.hpp | 10 +- .../constraints/copy-translation.hpp | 10 +- .../component}/constraints/spring-to.hpp | 10 +- .../component}/constraints/three-dof.hpp | 10 +- .../component}/constraints/track-to.hpp | 10 +- .../component}/diffuse-reflector.hpp | 10 +- .../components => game/component}/genome.hpp | 10 +- .../components => game/component}/light.hpp | 10 +- .../component}/locomotion.hpp | 10 +- .../components => game/component}/model.hpp | 10 +- .../components => game/component}/nest.hpp | 10 +- .../component}/observer.hpp | 10 +- .../components => game/component}/orbit.hpp | 10 +- .../components => game/component}/parent.hpp | 10 +- .../component}/proteome.hpp | 10 +- .../components => game/component}/samara.hpp | 10 +- .../components => game/component}/select.hpp | 10 +- .../components => game/component}/snap.hpp | 10 +- .../component}/steering.hpp | 10 +- .../components => game/component}/terrain.hpp | 10 +- .../components => game/component}/tool.hpp | 10 +- .../component}/trackable.hpp | 10 +- .../component}/transform.hpp | 10 +- src/game/context.hpp | 40 +++---- src/game/load.cpp | 2 +- src/game/state/boot.cpp | 76 ++++++------- src/game/state/main-menu.cpp | 6 +- src/game/state/nuptial-flight.cpp | 104 +++++++++--------- src/game/state/splash.cpp | 5 +- .../systems => game/system}/astronomy.cpp | 74 ++++++------- .../systems => game/system}/astronomy.hpp | 34 +++--- .../systems => game/system}/atmosphere.cpp | 20 ++-- .../systems => game/system}/atmosphere.hpp | 20 ++-- .../systems => game/system}/behavior.cpp | 10 +- .../systems => game/system}/behavior.hpp | 12 +- .../systems => game/system}/blackbody.cpp | 22 ++-- .../systems => game/system}/blackbody.hpp | 24 ++-- .../systems => game/system}/camera.cpp | 4 +- .../systems => game/system}/camera.hpp | 12 +- .../systems => game/system}/collision.cpp | 6 +- .../systems => game/system}/collision.hpp | 18 +-- .../systems => game/system}/constraint.cpp | 10 +- .../systems => game/system}/constraint.hpp | 20 ++-- .../systems => game/system}/locomotion.cpp | 10 +- .../systems => game/system}/locomotion.hpp | 12 +- .../systems => game/system}/morphogenesis.cpp | 6 +- .../systems => game/system}/morphogenesis.hpp | 12 +- src/{entity/systems => game/system}/orbit.cpp | 18 +-- src/{entity/systems => game/system}/orbit.hpp | 18 +-- .../systems => game/system}/painting.cpp | 14 +-- .../systems => game/system}/painting.hpp | 12 +- .../systems => game/system}/proteome.cpp | 20 ++-- .../systems => game/system}/proteome.hpp | 18 +-- .../systems => game/system}/render.cpp | 10 +- .../systems => game/system}/render.hpp | 28 ++--- .../systems => game/system}/samara.cpp | 8 +- .../systems => game/system}/samara.hpp | 12 +- .../systems => game/system}/snapping.cpp | 10 +- .../systems => game/system}/snapping.hpp | 12 +- .../systems => game/system}/spatial.cpp | 8 +- .../systems => game/system}/spatial.hpp | 12 +- .../systems => game/system}/steering.cpp | 10 +- .../systems => game/system}/steering.hpp | 12 +- .../systems => game/system}/subterrain.cpp | 18 +-- .../systems => game/system}/subterrain.hpp | 12 +- .../systems => game/system}/terrain.cpp | 12 +- .../systems => game/system}/terrain.hpp | 16 +-- .../systems => game/system}/updatable.cpp | 4 +- .../systems => game/system}/updatable.hpp | 10 +- .../systems => game/system}/vegetation.cpp | 8 +- .../systems => game/system}/vegetation.hpp | 16 +-- src/game/tools.cpp | 16 +-- src/game/world.cpp | 38 +++---- src/resources/entity-archetype-loader.cpp | 56 +++++----- 92 files changed, 729 insertions(+), 729 deletions(-) rename src/{entity/components => game/component}/atmosphere.hpp (92%) rename src/{entity/components => game/component}/behavior.hpp (79%) rename src/{entity/components => game/component}/blackbody.hpp (84%) rename src/{entity/components => game/component}/brush.hpp (82%) rename src/{entity/components => game/component}/camera.hpp (84%) rename src/{entity/components => game/component}/cavity.hpp (83%) rename src/{entity/components => game/component}/celestial-body.hpp (91%) rename src/{entity/components => game/component}/chamber.hpp (88%) rename src/{entity/components => game/component}/collision.hpp (84%) rename src/{entity/components => game/component}/constraint-stack.hpp (79%) rename src/{entity/components => game/component}/constraints/constraints.hpp (84%) rename src/{entity/components => game/component}/constraints/copy-rotation.hpp (81%) rename src/{entity/components => game/component}/constraints/copy-scale.hpp (83%) rename src/{entity/components => game/component}/constraints/copy-transform.hpp (81%) rename src/{entity/components => game/component}/constraints/copy-translation.hpp (85%) rename src/{entity/components => game/component}/constraints/spring-to.hpp (85%) rename src/{entity/components => game/component}/constraints/three-dof.hpp (83%) rename src/{entity/components => game/component}/constraints/track-to.hpp (83%) rename src/{entity/components => game/component}/diffuse-reflector.hpp (80%) rename src/{entity/components => game/component}/genome.hpp (89%) rename src/{entity/components => game/component}/light.hpp (85%) rename src/{entity/components => game/component}/locomotion.hpp (84%) rename src/{entity/components => game/component}/model.hpp (85%) rename src/{entity/components => game/component}/nest.hpp (85%) rename src/{entity/components => game/component}/observer.hpp (86%) rename src/{entity/components => game/component}/orbit.hpp (87%) rename src/{entity/components => game/component}/parent.hpp (83%) rename src/{entity/components => game/component}/proteome.hpp (84%) rename src/{entity/components => game/component}/samara.hpp (83%) rename src/{entity/components => game/component}/select.hpp (83%) rename src/{entity/components => game/component}/snap.hpp (84%) rename src/{entity/components => game/component}/steering.hpp (86%) rename src/{entity/components => game/component}/terrain.hpp (86%) rename src/{entity/components => game/component}/tool.hpp (84%) rename src/{entity/components => game/component}/trackable.hpp (82%) rename src/{entity/components => game/component}/transform.hpp (83%) rename src/{entity/systems => game/system}/astronomy.cpp (87%) rename src/{entity/systems => game/system}/astronomy.hpp (81%) rename src/{entity/systems => game/system}/atmosphere.cpp (87%) rename src/{entity/systems => game/system}/atmosphere.hpp (80%) rename src/{entity/systems => game/system}/behavior.cpp (89%) rename src/{entity/systems => game/system}/behavior.hpp (81%) rename src/{entity/systems => game/system}/blackbody.cpp (82%) rename src/{entity/systems => game/system}/blackbody.hpp (75%) rename src/{entity/systems => game/system}/camera.cpp (96%) rename src/{entity/systems => game/system}/camera.hpp (85%) rename src/{entity/systems => game/system}/collision.cpp (95%) rename src/{entity/systems => game/system}/collision.hpp (78%) rename src/{entity/systems => game/system}/constraint.cpp (97%) rename src/{entity/systems => game/system}/constraint.hpp (82%) rename src/{entity/systems => game/system}/locomotion.cpp (86%) rename src/{entity/systems => game/system}/locomotion.hpp (81%) rename src/{entity/systems => game/system}/morphogenesis.cpp (92%) rename src/{entity/systems => game/system}/morphogenesis.hpp (88%) rename src/{entity/systems => game/system}/orbit.cpp (80%) rename src/{entity/systems => game/system}/orbit.hpp (86%) rename src/{entity/systems => game/system}/painting.cpp (98%) rename src/{entity/systems => game/system}/painting.hpp (91%) rename src/{entity/systems => game/system}/proteome.cpp (78%) rename src/{entity/systems => game/system}/proteome.hpp (79%) rename src/{entity/systems => game/system}/render.cpp (97%) rename src/{entity/systems => game/system}/render.hpp (76%) rename src/{entity/systems => game/system}/samara.cpp (94%) rename src/{entity/systems => game/system}/samara.hpp (81%) rename src/{entity/systems => game/system}/snapping.cpp (94%) rename src/{entity/systems => game/system}/snapping.hpp (81%) rename src/{entity/systems => game/system}/spatial.cpp (93%) rename src/{entity/systems => game/system}/spatial.hpp (81%) rename src/{entity/systems => game/system}/steering.cpp (94%) rename src/{entity/systems => game/system}/steering.hpp (81%) rename src/{entity/systems => game/system}/subterrain.cpp (97%) rename src/{entity/systems => game/system}/subterrain.hpp (94%) rename src/{entity/systems => game/system}/terrain.cpp (98%) rename src/{entity/systems => game/system}/terrain.hpp (92%) rename src/{entity/systems => game/system}/updatable.cpp (95%) rename src/{entity/systems => game/system}/updatable.hpp (88%) rename src/{entity/systems => game/system}/vegetation.cpp (95%) rename src/{entity/systems => game/system}/vegetation.hpp (85%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7faddc1..8b94016 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.7) - option(VERSION_STRING "Project version string" "0.0.0") project(antkeeper VERSION ${VERSION_STRING} LANGUAGES CXX) diff --git a/src/color/cct.hpp b/src/color/cct.hpp index e9f3eb5..6178530 100644 --- a/src/color/cct.hpp +++ b/src/color/cct.hpp @@ -26,7 +26,7 @@ namespace color { -/// Functions which operate on correlated color temperature (CCT). +/// Correlated color temperature (CCT). namespace cct { /** diff --git a/src/entity/commands.cpp b/src/entity/commands.cpp index dde26bd..0a299d6 100644 --- a/src/entity/commands.cpp +++ b/src/entity/commands.cpp @@ -18,12 +18,12 @@ */ #include "entity/commands.hpp" -#include "entity/components/model.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/snap.hpp" -#include "entity/components/parent.hpp" -#include "entity/components/celestial-body.hpp" -#include "entity/components/terrain.hpp" +#include "game/component/model.hpp" +#include "game/component/transform.hpp" +#include "game/component/snap.hpp" +#include "game/component/parent.hpp" +#include "game/component/celestial-body.hpp" +#include "game/component/terrain.hpp" #include namespace entity { @@ -31,36 +31,36 @@ namespace command { void translate(entity::registry& registry, entity::id eid, const float3& translation) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.translation += translation; } } void rotate(entity::registry& registry, entity::id eid, float angle, const float3& axis) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.rotation = math::angle_axis(angle, axis) * transform.local.rotation; } } void move_to(entity::registry& registry, entity::id eid, const float3& position) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.translation = position; } } void warp_to(entity::registry& registry, entity::id eid, const float3& position) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.translation = position; transform.warp = true; } @@ -68,18 +68,18 @@ void warp_to(entity::registry& registry, entity::id eid, const float3& position) void set_scale(entity::registry& registry, entity::id eid, const float3& scale) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.scale = scale; } } void set_transform(entity::registry& registry, entity::id eid, const math::transform& transform, bool warp) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::transform& component = registry.get(eid); + game::component::transform& component = registry.get(eid); component.local = transform; component.warp = warp; } @@ -87,22 +87,22 @@ void set_transform(entity::registry& registry, entity::id eid, const math::trans void place(entity::registry& registry, entity::id eid, entity::id celestial_body_id, double altitude, double latitude, double longitude) { - if (registry.has(eid)) + if (registry.has(eid)) { double x = 0.0; double y = altitude; double z = 0.0; - if (registry.has(celestial_body_id)) + if (registry.has(celestial_body_id)) { - const component::celestial_body& celestial_body = registry.get(celestial_body_id); + const game::component::celestial_body& celestial_body = registry.get(celestial_body_id); x = longitude * math::two_pi * celestial_body.radius; z = -latitude * math::two_pi * celestial_body.radius; - if (registry.has(celestial_body_id)) + if (registry.has(celestial_body_id)) { - const component::terrain& terrain = registry.get(celestial_body_id); + const game::component::terrain& terrain = registry.get(celestial_body_id); if (terrain.elevation != nullptr) { @@ -111,7 +111,7 @@ void place(entity::registry& registry, entity::id eid, entity::id celestial_body } } - component::transform& transform = registry.get(eid); + game::component::transform& transform = registry.get(eid); transform.local.translation = math::type_cast(double3{x, y, z}); transform.warp = true; } @@ -119,14 +119,14 @@ void place(entity::registry& registry, entity::id eid, entity::id celestial_body void assign_render_layers(entity::registry& registry, entity::id eid, unsigned int layers) { - if (registry.has(eid)) + if (registry.has(eid)) { - component::model model = registry.get(eid); + game::component::model model = registry.get(eid); model.layers = layers; - registry.replace(eid, model); + registry.replace(eid, model); // Apply to child layers - registry.view().each( + registry.view().each( [&](entity::id eid, auto& component) { if (component.parent == eid) @@ -137,9 +137,9 @@ void assign_render_layers(entity::registry& registry, entity::id eid, unsigned i math::transform get_local_transform(entity::registry& registry, entity::id eid) { - if (registry.has(eid)) + if (registry.has(eid)) { - const component::transform& component = registry.get(eid); + const game::component::transform& component = registry.get(eid); return component.local; } @@ -148,9 +148,9 @@ math::transform get_local_transform(entity::registry& registry, entity::i math::transform get_world_transform(entity::registry& registry, entity::id eid) { - if (registry.has(eid)) + if (registry.has(eid)) { - const component::transform& component = registry.get(eid); + const game::component::transform& component = registry.get(eid); return component.world; } @@ -159,9 +159,9 @@ math::transform get_world_transform(entity::registry& registry, entity::i void parent(entity::registry& registry, entity::id child, entity::id parent) { - component::parent component; + game::component::parent component; component.parent = parent; - registry.assign_or_replace(child, component); + registry.assign_or_replace(child, component); } } // namespace command diff --git a/src/entity/ebt.cpp b/src/entity/ebt.cpp index c4bc7dc..84926b4 100644 --- a/src/entity/ebt.cpp +++ b/src/entity/ebt.cpp @@ -18,7 +18,7 @@ */ #include "entity/ebt.hpp" -#include "entity/components/transform.hpp" +#include "game/component/transform.hpp" #include namespace entity { @@ -38,7 +38,7 @@ status print_eid(context& context) status warp_to(context& context, float x, float y, float z) { - auto& transform = context.registry->get(context.entity_id); + auto& transform = context.registry->get(context.entity_id); transform.local.translation = {x, y, z}; transform.warp = true; return status::success; diff --git a/src/game/ant/swarm.cpp b/src/game/ant/swarm.cpp index 79b6c6b..156b152 100644 --- a/src/game/ant/swarm.cpp +++ b/src/game/ant/swarm.cpp @@ -18,9 +18,9 @@ */ #include "game/ant/swarm.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/steering.hpp" -#include "entity/components/model.hpp" +#include "game/component/transform.hpp" +#include "game/component/steering.hpp" +#include "game/component/model.hpp" #include "resources/resource-manager.hpp" #include "config.hpp" #include @@ -63,25 +63,25 @@ void create_swarm(game::context& ctx) const float3 queen_scale = {1, 1, 1}; // Init male model component - entity::component::model male_model; + game::component::model male_model; male_model.render_model = ctx.resource_manager->load("male-boid.mdl"); male_model.instance_count = 0; male_model.layers = 1; // Init queen model component - entity::component::model queen_model; + game::component::model queen_model; queen_model.render_model = ctx.resource_manager->load("queen-boid.mdl"); queen_model.instance_count = 0; queen_model.layers = 1; // Init transform component - entity::component::transform transform; + game::component::transform transform; transform.local = math::transform::identity; transform.world = transform.local; transform.warp = true; // Init steering component - entity::component::steering steering; + game::component::steering steering; steering.agent.mass = 1.0f; steering.agent.velocity = {0, 0, 0}; steering.agent.acceleration = {0, 0, 0}; @@ -114,32 +114,32 @@ void create_swarm(game::context& ctx) transform.local.translation = steering.agent.position; entity::id alate_eid = ctx.entity_registry->create(); - ctx.entity_registry->assign(alate_eid, steering); + ctx.entity_registry->assign(alate_eid, steering); if (i < male_count) { // Create male - ctx.entity_registry->assign(alate_eid, male_model); + ctx.entity_registry->assign(alate_eid, male_model); transform.local.scale = male_scale; transform.world = transform.local; - ctx.entity_registry->assign(alate_eid, transform); + ctx.entity_registry->assign(alate_eid, transform); } else { // Create queen - ctx.entity_registry->assign(alate_eid, queen_model); + ctx.entity_registry->assign(alate_eid, queen_model); transform.local.scale = queen_scale; transform.world = transform.local; - ctx.entity_registry->assign(alate_eid, transform); + ctx.entity_registry->assign(alate_eid, transform); } } } void destroy_swarm(game::context& ctx) { - auto view = ctx.entity_registry->view(); + auto view = ctx.entity_registry->view(); ctx.entity_registry->destroy(view.begin(), view.end()); } diff --git a/src/entity/components/atmosphere.hpp b/src/game/component/atmosphere.hpp similarity index 92% rename from src/entity/components/atmosphere.hpp rename to src/game/component/atmosphere.hpp index 340b21f..ef83827 100644 --- a/src/entity/components/atmosphere.hpp +++ b/src/game/component/atmosphere.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_ATMOSPHERE_HPP -#define ANTKEEPER_ENTITY_COMPONENT_ATMOSPHERE_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_ATMOSPHERE_HPP +#define ANTKEEPER_GAME_COMPONENT_ATMOSPHERE_HPP #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { /// Atmosphere @@ -81,6 +81,6 @@ struct atmosphere }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_ATMOSPHERE_HPP +#endif // ANTKEEPER_GAME_COMPONENT_ATMOSPHERE_HPP diff --git a/src/entity/components/behavior.hpp b/src/game/component/behavior.hpp similarity index 79% rename from src/entity/components/behavior.hpp rename to src/game/component/behavior.hpp index 0badb6a..86b8b66 100644 --- a/src/entity/components/behavior.hpp +++ b/src/game/component/behavior.hpp @@ -17,21 +17,21 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_BEHAVIOR_HPP -#define ANTKEEPER_ENTITY_COMPONENT_BEHAVIOR_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_BEHAVIOR_HPP +#define ANTKEEPER_GAME_COMPONENT_BEHAVIOR_HPP #include "entity/ebt.hpp" -namespace entity { +namespace game { namespace component { struct behavior { - const ebt::node* behavior_tree; + const entity::ebt::node* behavior_tree; }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_BEHAVIOR_HPP +#endif // ANTKEEPER_GAME_COMPONENT_BEHAVIOR_HPP diff --git a/src/entity/components/blackbody.hpp b/src/game/component/blackbody.hpp similarity index 84% rename from src/entity/components/blackbody.hpp rename to src/game/component/blackbody.hpp index 45932fe..b497839 100644 --- a/src/entity/components/blackbody.hpp +++ b/src/game/component/blackbody.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_BLACKBODY_HPP -#define ANTKEEPER_ENTITY_COMPONENT_BLACKBODY_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_BLACKBODY_HPP +#define ANTKEEPER_GAME_COMPONENT_BLACKBODY_HPP -namespace entity { +namespace game { namespace component { /// Blackbody radiator @@ -34,6 +34,6 @@ struct blackbody }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_BLACKBODY_HPP +#endif // ANTKEEPER_GAME_COMPONENT_BLACKBODY_HPP diff --git a/src/entity/components/brush.hpp b/src/game/component/brush.hpp similarity index 82% rename from src/entity/components/brush.hpp rename to src/game/component/brush.hpp index f12c55a..1db0077 100644 --- a/src/entity/components/brush.hpp +++ b/src/game/component/brush.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_BRUSH_HPP -#define ANTKEEPER_ENTITY_COMPONENT_BRUSH_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_BRUSH_HPP +#define ANTKEEPER_GAME_COMPONENT_BRUSH_HPP -namespace entity { +namespace game { namespace component { struct brush @@ -29,6 +29,6 @@ struct brush }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_BRUSH_HPP +#endif // ANTKEEPER_GAME_COMPONENT_BRUSH_HPP diff --git a/src/entity/components/camera.hpp b/src/game/component/camera.hpp similarity index 84% rename from src/entity/components/camera.hpp rename to src/game/component/camera.hpp index 284c4dd..c0b9360 100644 --- a/src/entity/components/camera.hpp +++ b/src/game/component/camera.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CAMERA_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CAMERA_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CAMERA_HPP +#define ANTKEEPER_GAME_COMPONENT_CAMERA_HPP #include "scene/camera.hpp" -namespace entity { +namespace game { namespace component { /// Camera scene object component. @@ -33,7 +33,7 @@ struct camera }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CAMERA_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CAMERA_HPP diff --git a/src/entity/components/cavity.hpp b/src/game/component/cavity.hpp similarity index 83% rename from src/entity/components/cavity.hpp rename to src/game/component/cavity.hpp index 98e6071..666e450 100644 --- a/src/entity/components/cavity.hpp +++ b/src/game/component/cavity.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CAVITY_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CAVITY_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CAVITY_HPP +#define ANTKEEPER_GAME_COMPONENT_CAVITY_HPP #include "math/math.hpp" -namespace entity { +namespace game { namespace component { struct cavity @@ -32,7 +32,7 @@ struct cavity }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CAVITY_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CAVITY_HPP diff --git a/src/entity/components/celestial-body.hpp b/src/game/component/celestial-body.hpp similarity index 91% rename from src/entity/components/celestial-body.hpp rename to src/game/component/celestial-body.hpp index 16460cd..0ad4a7e 100644 --- a/src/entity/components/celestial-body.hpp +++ b/src/game/component/celestial-body.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CELESTIAL_BODY_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CELESTIAL_BODY_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CELESTIAL_BODY_HPP +#define ANTKEEPER_GAME_COMPONENT_CELESTIAL_BODY_HPP -namespace entity { +namespace game { namespace component { /// A simple celestial body. @@ -60,6 +60,6 @@ struct celestial_body }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CELESTIAL_BODY_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CELESTIAL_BODY_HPP diff --git a/src/entity/components/chamber.hpp b/src/game/component/chamber.hpp similarity index 88% rename from src/entity/components/chamber.hpp rename to src/game/component/chamber.hpp index dc6062d..3495444 100644 --- a/src/entity/components/chamber.hpp +++ b/src/game/component/chamber.hpp @@ -17,14 +17,14 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CHAMBER_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CHAMBER_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CHAMBER_HPP +#define ANTKEEPER_GAME_COMPONENT_CHAMBER_HPP #include #include #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { /// Ant nest chamber. @@ -50,6 +50,6 @@ struct chamber }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CHAMBER_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CHAMBER_HPP diff --git a/src/entity/components/collision.hpp b/src/game/component/collision.hpp similarity index 84% rename from src/entity/components/collision.hpp rename to src/game/component/collision.hpp index a635498..4caf050 100644 --- a/src/entity/components/collision.hpp +++ b/src/game/component/collision.hpp @@ -17,14 +17,14 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_COLLISION_HPP -#define ANTKEEPER_ENTITY_COMPONENT_COLLISION_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_COLLISION_HPP +#define ANTKEEPER_GAME_COMPONENT_COLLISION_HPP #include "geom/aabb.hpp" #include "geom/mesh.hpp" #include "geom/mesh-accelerator.hpp" -namespace entity { +namespace game { namespace component { struct collision @@ -35,7 +35,7 @@ struct collision }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_COLLISION_HPP +#endif // ANTKEEPER_GAME_COMPONENT_COLLISION_HPP diff --git a/src/entity/components/constraint-stack.hpp b/src/game/component/constraint-stack.hpp similarity index 79% rename from src/entity/components/constraint-stack.hpp rename to src/game/component/constraint-stack.hpp index 0e4da8a..e2ed7c5 100644 --- a/src/entity/components/constraint-stack.hpp +++ b/src/game/component/constraint-stack.hpp @@ -17,19 +17,19 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_STACK_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_STACK_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_STACK_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_STACK_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { /** * Causes an ordered stack of constraints to be applied to an entity. * - * @see entity::component::constraint_stack_node - * @see entity::component::constraint + * @see game::component::constraint_stack_node + * @see game::component::constraint */ struct constraint_stack { @@ -40,8 +40,8 @@ struct constraint_stack /** * Single node in a constraint stack. Allows toggling and weighing of constraints and links to the following constraint stack node (if any). * - * @see entity::component::constraint_stack - * @see entity::component::constraint + * @see game::component::constraint_stack + * @see game::component::constraint */ struct constraint_stack_node { @@ -56,6 +56,6 @@ struct constraint_stack_node }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_STACK_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_STACK_HPP diff --git a/src/entity/components/constraints/constraints.hpp b/src/game/component/constraints/constraints.hpp similarity index 84% rename from src/entity/components/constraints/constraints.hpp rename to src/game/component/constraints/constraints.hpp index 6269671..611fcff 100644 --- a/src/entity/components/constraints/constraints.hpp +++ b/src/game/component/constraints/constraints.hpp @@ -17,17 +17,17 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINTS_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINTS_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINTS_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINTS_HPP -namespace entity { +namespace game { namespace component { /// Transform constraint components namespace constraint {} } // namespace component -} // namespace entity +} // namespace game #include "copy-translation.hpp" #include "copy-rotation.hpp" @@ -37,4 +37,4 @@ namespace constraint {} #include "spring-to.hpp" #include "three-dof.hpp" -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINTS_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINTS_HPP diff --git a/src/entity/components/constraints/copy-rotation.hpp b/src/game/component/constraints/copy-rotation.hpp similarity index 81% rename from src/entity/components/constraints/copy-rotation.hpp rename to src/game/component/constraints/copy-rotation.hpp index b82785e..339042a 100644 --- a/src/entity/components/constraints/copy-rotation.hpp +++ b/src/game/component/constraints/copy-rotation.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -37,6 +37,6 @@ struct copy_rotation } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_ROTATION_HPP diff --git a/src/entity/components/constraints/copy-scale.hpp b/src/game/component/constraints/copy-scale.hpp similarity index 83% rename from src/entity/components/constraints/copy-scale.hpp rename to src/game/component/constraints/copy-scale.hpp index 74dfb0c..da49be4 100644 --- a/src/entity/components/constraints/copy-scale.hpp +++ b/src/game/component/constraints/copy-scale.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_SCALE_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_SCALE_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_SCALE_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_SCALE_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -46,6 +46,6 @@ struct copy_scale } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_SCALE_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_SCALE_HPP diff --git a/src/entity/components/constraints/copy-transform.hpp b/src/game/component/constraints/copy-transform.hpp similarity index 81% rename from src/entity/components/constraints/copy-transform.hpp rename to src/game/component/constraints/copy-transform.hpp index 74f6719..dd242d9 100644 --- a/src/entity/components/constraints/copy-transform.hpp +++ b/src/game/component/constraints/copy-transform.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -37,6 +37,6 @@ struct copy_transform } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSFORM_HPP diff --git a/src/entity/components/constraints/copy-translation.hpp b/src/game/component/constraints/copy-translation.hpp similarity index 85% rename from src/entity/components/constraints/copy-translation.hpp rename to src/game/component/constraints/copy-translation.hpp index b642880..e49d7af 100644 --- a/src/entity/components/constraints/copy-translation.hpp +++ b/src/game/component/constraints/copy-translation.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -58,6 +58,6 @@ struct copy_translation } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_COPY_TRANSLATION_HPP diff --git a/src/entity/components/constraints/spring-to.hpp b/src/game/component/constraints/spring-to.hpp similarity index 85% rename from src/entity/components/constraints/spring-to.hpp rename to src/game/component/constraints/spring-to.hpp index 716e08a..348e70f 100644 --- a/src/entity/components/constraints/spring-to.hpp +++ b/src/game/component/constraints/spring-to.hpp @@ -17,14 +17,14 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_SPRING_TO_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_SPRING_TO_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_SPRING_TO_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_SPRING_TO_HPP #include "entity/id.hpp" #include "animation/spring.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -51,6 +51,6 @@ struct spring_to } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_SPRING_TO_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_SPRING_TO_HPP diff --git a/src/entity/components/constraints/three-dof.hpp b/src/game/component/constraints/three-dof.hpp similarity index 83% rename from src/entity/components/constraints/three-dof.hpp rename to src/game/component/constraints/three-dof.hpp index 6fcad80..c88fa6e 100644 --- a/src/entity/components/constraints/three-dof.hpp +++ b/src/game/component/constraints/three-dof.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_THREE_DOF_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_THREE_DOF_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_THREE_DOF_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_THREE_DOF_HPP -namespace entity { +namespace game { namespace component { namespace constraint { @@ -41,6 +41,6 @@ struct three_dof } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_THREE_DOF_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_THREE_DOF_HPP diff --git a/src/entity/components/constraints/track-to.hpp b/src/game/component/constraints/track-to.hpp similarity index 83% rename from src/entity/components/constraints/track-to.hpp rename to src/game/component/constraints/track-to.hpp index 60a89f9..44a21c9 100644 --- a/src/entity/components/constraints/track-to.hpp +++ b/src/game/component/constraints/track-to.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_TRACK_TO_HPP -#define ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_TRACK_TO_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_CONSTRAINT_TRACK_TO_HPP +#define ANTKEEPER_GAME_COMPONENT_CONSTRAINT_TRACK_TO_HPP #include "entity/id.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { namespace constraint { @@ -41,6 +41,6 @@ struct track_to } // namespace constraint } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_CONSTRAINT_TRACK_TO_HPP +#endif // ANTKEEPER_GAME_COMPONENT_CONSTRAINT_TRACK_TO_HPP diff --git a/src/entity/components/diffuse-reflector.hpp b/src/game/component/diffuse-reflector.hpp similarity index 80% rename from src/entity/components/diffuse-reflector.hpp rename to src/game/component/diffuse-reflector.hpp index 74cde3a..2a3a465 100644 --- a/src/entity/components/diffuse-reflector.hpp +++ b/src/game/component/diffuse-reflector.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_DIFFUSE_REFLECTOR_HPP -#define ANTKEEPER_ENTITY_COMPONENT_DIFFUSE_REFLECTOR_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_DIFFUSE_REFLECTOR_HPP +#define ANTKEEPER_GAME_COMPONENT_DIFFUSE_REFLECTOR_HPP -namespace entity { +namespace game { namespace component { struct diffuse_reflector @@ -29,6 +29,6 @@ struct diffuse_reflector }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_DIFFUSE_REFLECTOR_HPP +#endif // ANTKEEPER_GAME_COMPONENT_DIFFUSE_REFLECTOR_HPP diff --git a/src/entity/components/genome.hpp b/src/game/component/genome.hpp similarity index 89% rename from src/entity/components/genome.hpp rename to src/game/component/genome.hpp index a1941f0..1848927 100644 --- a/src/entity/components/genome.hpp +++ b/src/game/component/genome.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_GENOME_HPP -#define ANTKEEPER_ENTITY_COMPONENT_GENOME_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_GENOME_HPP +#define ANTKEEPER_GAME_COMPONENT_GENOME_HPP #include #include -namespace entity { +namespace game { namespace component { /// Complete set of genetic material in an organism. @@ -45,6 +45,6 @@ struct genome }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_GENOME_HPP +#endif // ANTKEEPER_GAME_COMPONENT_GENOME_HPP diff --git a/src/entity/components/light.hpp b/src/game/component/light.hpp similarity index 85% rename from src/entity/components/light.hpp rename to src/game/component/light.hpp index 4bfe5a1..087044b 100644 --- a/src/entity/components/light.hpp +++ b/src/game/component/light.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_LIGHT_HPP -#define ANTKEEPER_ENTITY_COMPONENT_LIGHT_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_LIGHT_HPP +#define ANTKEEPER_GAME_COMPONENT_LIGHT_HPP #include "utility/fundamental-types.hpp" #include "scene/light.hpp" -namespace entity { +namespace game { namespace component { struct light @@ -36,7 +36,7 @@ struct light }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_LIGHT_HPP +#endif // ANTKEEPER_GAME_COMPONENT_LIGHT_HPP diff --git a/src/entity/components/locomotion.hpp b/src/game/component/locomotion.hpp similarity index 84% rename from src/entity/components/locomotion.hpp rename to src/game/component/locomotion.hpp index a1d4553..1ff3daf 100644 --- a/src/entity/components/locomotion.hpp +++ b/src/game/component/locomotion.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_PLACEMENT_HPP -#define ANTKEEPER_ENTITY_COMPONENT_PLACEMENT_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_PLACEMENT_HPP +#define ANTKEEPER_GAME_COMPONENT_PLACEMENT_HPP #include "geom/mesh.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { struct locomotion @@ -35,7 +35,7 @@ struct locomotion }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_PLACEMENT_HPP +#endif // ANTKEEPER_GAME_COMPONENT_PLACEMENT_HPP diff --git a/src/entity/components/model.hpp b/src/game/component/model.hpp similarity index 85% rename from src/entity/components/model.hpp rename to src/game/component/model.hpp index e3d6c80..8b5288e 100644 --- a/src/entity/components/model.hpp +++ b/src/game/component/model.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_MODEL_HPP -#define ANTKEEPER_ENTITY_COMPONENT_MODEL_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_MODEL_HPP +#define ANTKEEPER_GAME_COMPONENT_MODEL_HPP #include "render/model.hpp" #include -namespace entity { +namespace game { namespace component { struct model @@ -35,6 +35,6 @@ struct model }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_MODEL_HPP +#endif // ANTKEEPER_GAME_COMPONENT_MODEL_HPP diff --git a/src/entity/components/nest.hpp b/src/game/component/nest.hpp similarity index 85% rename from src/entity/components/nest.hpp rename to src/game/component/nest.hpp index 9346e90..f4dcd83 100644 --- a/src/entity/components/nest.hpp +++ b/src/game/component/nest.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_NEST_HPP -#define ANTKEEPER_ENTITY_COMPONENT_NEST_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_NEST_HPP +#define ANTKEEPER_GAME_COMPONENT_NEST_HPP #include #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { struct nest @@ -36,6 +36,6 @@ struct nest }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_NEST_HPP +#endif // ANTKEEPER_GAME_COMPONENT_NEST_HPP diff --git a/src/entity/components/observer.hpp b/src/game/component/observer.hpp similarity index 86% rename from src/entity/components/observer.hpp rename to src/game/component/observer.hpp index aadb678..fdf5e87 100644 --- a/src/entity/components/observer.hpp +++ b/src/game/component/observer.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_OBSERVER_HPP -#define ANTKEEPER_ENTITY_COMPONENT_OBSERVER_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_OBSERVER_HPP +#define ANTKEEPER_GAME_COMPONENT_OBSERVER_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { /** @@ -44,6 +44,6 @@ struct observer }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_OBSERVER_HPP +#endif // ANTKEEPER_GAME_COMPONENT_OBSERVER_HPP diff --git a/src/entity/components/orbit.hpp b/src/game/component/orbit.hpp similarity index 87% rename from src/entity/components/orbit.hpp rename to src/game/component/orbit.hpp index f31f379..4d61c8d 100644 --- a/src/entity/components/orbit.hpp +++ b/src/game/component/orbit.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_ORBIT_HPP -#define ANTKEEPER_ENTITY_COMPONENT_ORBIT_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_ORBIT_HPP +#define ANTKEEPER_GAME_COMPONENT_ORBIT_HPP #include "entity/id.hpp" #include "math/vector-type.hpp" -namespace entity { +namespace game { namespace component { struct orbit @@ -42,6 +42,6 @@ struct orbit }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_ORBIT_HPP +#endif // ANTKEEPER_GAME_COMPONENT_ORBIT_HPP diff --git a/src/entity/components/parent.hpp b/src/game/component/parent.hpp similarity index 83% rename from src/entity/components/parent.hpp rename to src/game/component/parent.hpp index 0635e70..f847975 100644 --- a/src/entity/components/parent.hpp +++ b/src/game/component/parent.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_PARENT_HPP -#define ANTKEEPER_ENTITY_COMPONENT_PARENT_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_PARENT_HPP +#define ANTKEEPER_GAME_COMPONENT_PARENT_HPP #include "entity/id.hpp" -namespace entity { +namespace game { namespace component { struct parent @@ -31,6 +31,6 @@ struct parent }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_PARENT_HPP +#endif // ANTKEEPER_GAME_COMPONENT_PARENT_HPP diff --git a/src/entity/components/proteome.hpp b/src/game/component/proteome.hpp similarity index 84% rename from src/entity/components/proteome.hpp rename to src/game/component/proteome.hpp index 5d6e184..cf5e0e9 100644 --- a/src/entity/components/proteome.hpp +++ b/src/game/component/proteome.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_PROTEOME_HPP -#define ANTKEEPER_ENTITY_COMPONENT_PROTEOME_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_PROTEOME_HPP +#define ANTKEEPER_GAME_COMPONENT_PROTEOME_HPP #include #include -namespace entity { +namespace game { namespace component { /// Set of all proteins that can be expressed by an organism. @@ -34,6 +34,6 @@ struct proteome }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_PROTEOME_HPP +#endif // ANTKEEPER_GAME_COMPONENT_PROTEOME_HPP diff --git a/src/entity/components/samara.hpp b/src/game/component/samara.hpp similarity index 83% rename from src/entity/components/samara.hpp rename to src/game/component/samara.hpp index 75cca63..f7a5bcf 100644 --- a/src/entity/components/samara.hpp +++ b/src/game/component/samara.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_SAMARA_HPP -#define ANTKEEPER_ENTITY_COMPONENT_SAMARA_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_SAMARA_HPP +#define ANTKEEPER_GAME_COMPONENT_SAMARA_HPP #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { struct samara @@ -33,7 +33,7 @@ struct samara }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_SAMARA_HPP +#endif // ANTKEEPER_GAME_COMPONENT_SAMARA_HPP diff --git a/src/entity/components/select.hpp b/src/game/component/select.hpp similarity index 83% rename from src/entity/components/select.hpp rename to src/game/component/select.hpp index e02b66b..a3b1094 100644 --- a/src/entity/components/select.hpp +++ b/src/game/component/select.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_SELECT_HPP -#define ANTKEEPER_ENTITY_COMPONENT_SELECT_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_SELECT_HPP +#define ANTKEEPER_GAME_COMPONENT_SELECT_HPP -namespace entity { +namespace game { namespace component { /// Allows an entity to be selected. @@ -31,6 +31,6 @@ struct select }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_SELECT_HPP +#endif // ANTKEEPER_GAME_COMPONENT_SELECT_HPP diff --git a/src/entity/components/snap.hpp b/src/game/component/snap.hpp similarity index 84% rename from src/entity/components/snap.hpp rename to src/game/component/snap.hpp index 45b1ee1..9b6f78f 100644 --- a/src/entity/components/snap.hpp +++ b/src/game/component/snap.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_SNAP_HPP -#define ANTKEEPER_ENTITY_COMPONENT_SNAP_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_SNAP_HPP +#define ANTKEEPER_GAME_COMPONENT_SNAP_HPP #include "geom/ray.hpp" -namespace entity { +namespace game { namespace component { struct snap @@ -34,7 +34,7 @@ struct snap }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_SNAP_HPP +#endif // ANTKEEPER_GAME_COMPONENT_SNAP_HPP diff --git a/src/entity/components/steering.hpp b/src/game/component/steering.hpp similarity index 86% rename from src/entity/components/steering.hpp rename to src/game/component/steering.hpp index 1fe34dd..2af17cc 100644 --- a/src/entity/components/steering.hpp +++ b/src/game/component/steering.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_STEERING_HPP -#define ANTKEEPER_ENTITY_COMPONENT_STEERING_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_STEERING_HPP +#define ANTKEEPER_GAME_COMPONENT_STEERING_HPP #include "ai/steering/agent.hpp" -namespace entity { +namespace game { namespace component { struct steering @@ -50,6 +50,6 @@ struct steering }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_STEERING_HPP +#endif // ANTKEEPER_GAME_COMPONENT_STEERING_HPP diff --git a/src/entity/components/terrain.hpp b/src/game/component/terrain.hpp similarity index 86% rename from src/entity/components/terrain.hpp rename to src/game/component/terrain.hpp index 0ae6dfd..c39e813 100644 --- a/src/entity/components/terrain.hpp +++ b/src/game/component/terrain.hpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_TERRAIN_HPP -#define ANTKEEPER_ENTITY_COMPONENT_TERRAIN_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_TERRAIN_HPP +#define ANTKEEPER_GAME_COMPONENT_TERRAIN_HPP #include "render/material.hpp" #include -namespace entity { +namespace game { namespace component { struct terrain @@ -39,6 +39,6 @@ struct terrain }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_TERRAIN_HPP +#endif // ANTKEEPER_GAME_COMPONENT_TERRAIN_HPP diff --git a/src/entity/components/tool.hpp b/src/game/component/tool.hpp similarity index 84% rename from src/entity/components/tool.hpp rename to src/game/component/tool.hpp index f8a4f7b..ecc8139 100644 --- a/src/entity/components/tool.hpp +++ b/src/game/component/tool.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_TOOL_HPP -#define ANTKEEPER_ENTITY_COMPONENT_TOOL_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_TOOL_HPP +#define ANTKEEPER_GAME_COMPONENT_TOOL_HPP #include -namespace entity { +namespace game { namespace component { struct tool @@ -33,7 +33,7 @@ struct tool }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_TOOL_HPP +#endif // ANTKEEPER_GAME_COMPONENT_TOOL_HPP diff --git a/src/entity/components/trackable.hpp b/src/game/component/trackable.hpp similarity index 82% rename from src/entity/components/trackable.hpp rename to src/game/component/trackable.hpp index 6193ba4..7514f30 100644 --- a/src/entity/components/trackable.hpp +++ b/src/game/component/trackable.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_TRACKABLE_HPP -#define ANTKEEPER_ENTITY_COMPONENT_TRACKABLE_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_TRACKABLE_HPP +#define ANTKEEPER_GAME_COMPONENT_TRACKABLE_HPP #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace component { struct trackable @@ -31,6 +31,6 @@ struct trackable }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_TRACKABLE_HPP +#endif // ANTKEEPER_GAME_COMPONENT_TRACKABLE_HPP diff --git a/src/entity/components/transform.hpp b/src/game/component/transform.hpp similarity index 83% rename from src/entity/components/transform.hpp rename to src/game/component/transform.hpp index c5f3a86..dd7f005 100644 --- a/src/entity/components/transform.hpp +++ b/src/game/component/transform.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_COMPONENT_TRANSFORM_HPP -#define ANTKEEPER_ENTITY_COMPONENT_TRANSFORM_HPP +#ifndef ANTKEEPER_GAME_COMPONENT_TRANSFORM_HPP +#define ANTKEEPER_GAME_COMPONENT_TRANSFORM_HPP #include "math/math.hpp" -namespace entity { +namespace game { namespace component { struct transform @@ -33,7 +33,7 @@ struct transform }; } // namespace component -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_COMPONENT_TRANSFORM_HPP +#endif // ANTKEEPER_GAME_COMPONENT_TRANSFORM_HPP diff --git a/src/game/context.hpp b/src/game/context.hpp index d4e7488..62c44f3 100644 --- a/src/game/context.hpp +++ b/src/game/context.hpp @@ -74,7 +74,7 @@ namespace debug class logger; } -namespace entity +namespace game { namespace system { @@ -275,25 +275,25 @@ struct context std::unordered_map entities; // Systems - entity::system::behavior* behavior_system; - entity::system::camera* camera_system; - entity::system::collision* collision_system; - entity::system::constraint* constraint_system; - entity::system::locomotion* locomotion_system; - entity::system::steering* steering_system; - entity::system::snapping* snapping_system; - entity::system::render* render_system; - entity::system::samara* samara_system; - entity::system::subterrain* subterrain_system; - entity::system::terrain* terrain_system; - entity::system::vegetation* vegetation_system; - entity::system::spatial* spatial_system; - entity::system::painting* painting_system; - entity::system::blackbody* blackbody_system; - entity::system::atmosphere* atmosphere_system; - entity::system::astronomy* astronomy_system; - entity::system::orbit* orbit_system; - entity::system::proteome* proteome_system; + game::system::behavior* behavior_system; + game::system::camera* camera_system; + game::system::collision* collision_system; + game::system::constraint* constraint_system; + game::system::locomotion* locomotion_system; + game::system::steering* steering_system; + game::system::snapping* snapping_system; + game::system::render* render_system; + game::system::samara* samara_system; + game::system::subterrain* subterrain_system; + game::system::terrain* terrain_system; + game::system::vegetation* vegetation_system; + game::system::spatial* spatial_system; + game::system::painting* painting_system; + game::system::blackbody* blackbody_system; + game::system::atmosphere* atmosphere_system; + game::system::astronomy* astronomy_system; + game::system::orbit* orbit_system; + game::system::proteome* proteome_system; double3 rgb_wavelengths; }; diff --git a/src/game/load.cpp b/src/game/load.cpp index 89a60d0..925b01c 100644 --- a/src/game/load.cpp +++ b/src/game/load.cpp @@ -27,7 +27,7 @@ #include "render/material.hpp" #include "render/passes/sky-pass.hpp" #include "render/passes/ground-pass.hpp" -#include "entity/systems/astronomy.hpp" +#include "game/system/astronomy.hpp" #include namespace game { diff --git a/src/game/state/boot.cpp b/src/game/state/boot.cpp index 0f88ef3..2c23559 100644 --- a/src/game/state/boot.cpp +++ b/src/game/state/boot.cpp @@ -56,25 +56,25 @@ #include "resources/file-buffer.hpp" #include "scene/scene.hpp" #include "game/state/splash.hpp" -#include "entity/systems/behavior.hpp" -#include "entity/systems/camera.hpp" -#include "entity/systems/collision.hpp" -#include "entity/systems/constraint.hpp" -#include "entity/systems/locomotion.hpp" -#include "entity/systems/snapping.hpp" -#include "entity/systems/render.hpp" -#include "entity/systems/samara.hpp" -#include "entity/systems/subterrain.hpp" -#include "entity/systems/terrain.hpp" -#include "entity/systems/vegetation.hpp" -#include "entity/systems/spatial.hpp" -#include "entity/systems/painting.hpp" -#include "entity/systems/astronomy.hpp" -#include "entity/systems/blackbody.hpp" -#include "entity/systems/atmosphere.hpp" -#include "entity/systems/orbit.hpp" -#include "entity/systems/proteome.hpp" -#include "entity/systems/steering.hpp" +#include "game/system/behavior.hpp" +#include "game/system/camera.hpp" +#include "game/system/collision.hpp" +#include "game/system/constraint.hpp" +#include "game/system/locomotion.hpp" +#include "game/system/snapping.hpp" +#include "game/system/render.hpp" +#include "game/system/samara.hpp" +#include "game/system/subterrain.hpp" +#include "game/system/terrain.hpp" +#include "game/system/vegetation.hpp" +#include "game/system/spatial.hpp" +#include "game/system/painting.hpp" +#include "game/system/astronomy.hpp" +#include "game/system/blackbody.hpp" +#include "game/system/atmosphere.hpp" +#include "game/system/orbit.hpp" +#include "game/system/proteome.hpp" +#include "game/system/steering.hpp" #include "entity/commands.hpp" #include "utility/paths.hpp" #include "event/event-dispatcher.hpp" @@ -834,13 +834,13 @@ void boot::setup_systems() float4 viewport = {0.0f, 0.0f, static_cast(viewport_dimensions[0]), static_cast(viewport_dimensions[1])}; // Setup terrain system - ctx.terrain_system = new entity::system::terrain(*ctx.entity_registry); + ctx.terrain_system = new game::system::terrain(*ctx.entity_registry); ctx.terrain_system->set_patch_subdivisions(30); ctx.terrain_system->set_patch_scene_collection(ctx.surface_scene); ctx.terrain_system->set_max_error(200.0); // Setup vegetation system - //ctx.vegetation_system = new entity::system::vegetation(*ctx.entity_registry); + //ctx.vegetation_system = new game::system::vegetation(*ctx.entity_registry); //ctx.vegetation_system->set_terrain_patch_size(TERRAIN_PATCH_SIZE); //ctx.vegetation_system->set_vegetation_patch_resolution(VEGETATION_PATCH_RESOLUTION); //ctx.vegetation_system->set_vegetation_density(1.0f); @@ -848,67 +848,67 @@ void boot::setup_systems() //ctx.vegetation_system->set_scene(ctx.surface_scene); // Setup camera system - ctx.camera_system = new entity::system::camera(*ctx.entity_registry); + ctx.camera_system = new game::system::camera(*ctx.entity_registry); ctx.camera_system->set_viewport(viewport); event_dispatcher->subscribe(ctx.camera_system); // Setup subterrain system - ctx.subterrain_system = new entity::system::subterrain(*ctx.entity_registry, ctx.resource_manager); + ctx.subterrain_system = new game::system::subterrain(*ctx.entity_registry, ctx.resource_manager); ctx.subterrain_system->set_scene(ctx.underground_scene); // Setup collision system - ctx.collision_system = new entity::system::collision(*ctx.entity_registry); + ctx.collision_system = new game::system::collision(*ctx.entity_registry); // Setup samara system - ctx.samara_system = new entity::system::samara(*ctx.entity_registry); + ctx.samara_system = new game::system::samara(*ctx.entity_registry); // Setup snapping system - ctx.snapping_system = new entity::system::snapping(*ctx.entity_registry); + ctx.snapping_system = new game::system::snapping(*ctx.entity_registry); // Setup behavior system - ctx.behavior_system = new entity::system::behavior(*ctx.entity_registry); + ctx.behavior_system = new game::system::behavior(*ctx.entity_registry); // Setup locomotion system - ctx.locomotion_system = new entity::system::locomotion(*ctx.entity_registry); + ctx.locomotion_system = new game::system::locomotion(*ctx.entity_registry); // Setup steering system - ctx.steering_system = new entity::system::steering(*ctx.entity_registry); + ctx.steering_system = new game::system::steering(*ctx.entity_registry); // Setup spatial system - ctx.spatial_system = new entity::system::spatial(*ctx.entity_registry); + ctx.spatial_system = new game::system::spatial(*ctx.entity_registry); // Setup constraint system - ctx.constraint_system = new entity::system::constraint(*ctx.entity_registry); + ctx.constraint_system = new game::system::constraint(*ctx.entity_registry); // Setup painting system - ctx.painting_system = new entity::system::painting(*ctx.entity_registry, event_dispatcher, ctx.resource_manager); + ctx.painting_system = new game::system::painting(*ctx.entity_registry, event_dispatcher, ctx.resource_manager); ctx.painting_system->set_scene(ctx.surface_scene); // Setup orbit system - ctx.orbit_system = new entity::system::orbit(*ctx.entity_registry); + ctx.orbit_system = new game::system::orbit(*ctx.entity_registry); // Setup blackbody system - ctx.blackbody_system = new entity::system::blackbody(*ctx.entity_registry); + ctx.blackbody_system = new game::system::blackbody(*ctx.entity_registry); ctx.blackbody_system->set_illuminant(color::illuminant::deg2::d55); // RGB wavelengths for atmospheric scatteering ctx.rgb_wavelengths = {645, 575, 440}; // Setup atmosphere system - ctx.atmosphere_system = new entity::system::atmosphere(*ctx.entity_registry); + ctx.atmosphere_system = new game::system::atmosphere(*ctx.entity_registry); ctx.atmosphere_system->set_rgb_wavelengths(ctx.rgb_wavelengths * 1e-9); ctx.atmosphere_system->set_sky_pass(ctx.sky_pass); // Setup astronomy system - ctx.astronomy_system = new entity::system::astronomy(*ctx.entity_registry); + ctx.astronomy_system = new game::system::astronomy(*ctx.entity_registry); ctx.astronomy_system->set_transmittance_samples(16); ctx.astronomy_system->set_sky_pass(ctx.sky_pass); // Setup proteome system - ctx.proteome_system = new entity::system::proteome(*ctx.entity_registry); + ctx.proteome_system = new game::system::proteome(*ctx.entity_registry); // Setup render system - ctx.render_system = new entity::system::render(*ctx.entity_registry); + ctx.render_system = new game::system::render(*ctx.entity_registry); //ctx.render_system->add_layer(ctx.underground_scene); ctx.render_system->add_layer(ctx.surface_scene); ctx.render_system->add_layer(ctx.ui_scene); diff --git a/src/game/state/main-menu.cpp b/src/game/state/main-menu.cpp index e8a60b1..e83ba33 100644 --- a/src/game/state/main-menu.cpp +++ b/src/game/state/main-menu.cpp @@ -37,9 +37,9 @@ #include "application.hpp" #include "config.hpp" #include "physics/light/exposure.hpp" -#include "entity/components/model.hpp" -#include "entity/components/steering.hpp" -#include "entity/components/transform.hpp" +#include "game/component/model.hpp" +#include "game/component/steering.hpp" +#include "game/component/transform.hpp" #include namespace game { diff --git a/src/game/state/nuptial-flight.cpp b/src/game/state/nuptial-flight.cpp index ce4723c..dd7785a 100644 --- a/src/game/state/nuptial-flight.cpp +++ b/src/game/state/nuptial-flight.cpp @@ -21,18 +21,18 @@ #include "game/state/pause-menu.hpp" #include "game/ant/swarm.hpp" #include "entity/archetype.hpp" -#include "entity/systems/camera.hpp" -#include "entity/systems/astronomy.hpp" -#include "entity/systems/atmosphere.hpp" -#include "entity/components/locomotion.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/terrain.hpp" -#include "entity/components/camera.hpp" -#include "entity/components/model.hpp" -#include "entity/components/constraints/spring-to.hpp" -#include "entity/components/constraints/three-dof.hpp" -#include "entity/components/constraint-stack.hpp" -#include "entity/components/steering.hpp" +#include "game/system/camera.hpp" +#include "game/system/astronomy.hpp" +#include "game/system/atmosphere.hpp" +#include "game/component/locomotion.hpp" +#include "game/component/transform.hpp" +#include "game/component/terrain.hpp" +#include "game/component/camera.hpp" +#include "game/component/model.hpp" +#include "game/component/constraints/spring-to.hpp" +#include "game/component/constraints/three-dof.hpp" +#include "game/component/constraint-stack.hpp" +#include "game/component/steering.hpp" #include "entity/commands.hpp" #include "animation/screen-transition.hpp" #include "animation/ease.hpp" @@ -183,11 +183,11 @@ void nuptial_flight::setup_camera() ctx.entities["surface_cam_target"] = target_eid; { // Transform - entity::component::transform target_transform; + game::component::transform target_transform; target_transform.local = math::transform::identity; target_transform.world = target_transform.local; target_transform.warp = true; - ctx.entity_registry->assign(target_eid, target_transform); + ctx.entity_registry->assign(target_eid, target_transform); } // Create camera entity @@ -195,61 +195,61 @@ void nuptial_flight::setup_camera() ctx.entities["surface_cam"] = camera_eid; // Create camera transform component - entity::component::transform transform; + game::component::transform transform; transform.local = math::transform::identity; transform.world = transform.local; transform.warp = true; - ctx.entity_registry->assign(camera_eid, transform); + ctx.entity_registry->assign(camera_eid, transform); // Create camera camera component - entity::component::camera camera; + game::component::camera camera; camera.object = ctx.surface_camera; - ctx.entity_registry->assign(camera_eid, camera); + ctx.entity_registry->assign(camera_eid, camera); // Create camera 3DOF constraint entity entity::id three_dof_constraint_eid = ctx.entity_registry->create(); ctx.entities["surface_cam_3dof"] = three_dof_constraint_eid; { // Create 3DOF to constraint - entity::component::constraint::three_dof three_dof; + game::component::constraint::three_dof three_dof; three_dof.yaw = 0.0f; three_dof.pitch = 0.0f; three_dof.roll = 0.0f; - ctx.entity_registry->assign(three_dof_constraint_eid, three_dof); + ctx.entity_registry->assign(three_dof_constraint_eid, three_dof); // Create constraint stack node component - entity::component::constraint_stack_node node; + game::component::constraint_stack_node node; node.active = true; node.weight = 1.0f; node.next = entt::null; - ctx.entity_registry->assign(three_dof_constraint_eid, node); + ctx.entity_registry->assign(three_dof_constraint_eid, node); } // Create camera spring to constraint entity entity::id spring_constraint_eid = ctx.entity_registry->create(); { // Create spring to constraint - entity::component::constraint::spring_to spring; + game::component::constraint::spring_to spring; spring.target = target_eid; spring.translation = {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 1.0f, math::two_pi}; spring.translation.w = hz_to_rads(8.0f); spring.spring_translation = true; spring.spring_rotation = false; - ctx.entity_registry->assign(spring_constraint_eid, spring); + ctx.entity_registry->assign(spring_constraint_eid, spring); // Create constraint stack node component - entity::component::constraint_stack_node node; + game::component::constraint_stack_node node; node.active = true; node.weight = 1.0f; node.next = three_dof_constraint_eid; - ctx.entity_registry->assign(spring_constraint_eid, node); + ctx.entity_registry->assign(spring_constraint_eid, node); } // Create camera constraint stack component - entity::component::constraint_stack constraint_stack; + game::component::constraint_stack constraint_stack; constraint_stack.head = spring_constraint_eid; - ctx.entity_registry->assign(camera_eid, constraint_stack); + ctx.entity_registry->assign(camera_eid, constraint_stack); } game::ant::create_swarm(ctx); @@ -324,7 +324,7 @@ void nuptial_flight::enable_keeper_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); const math::quaternion yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {0.0f, 0.0f, -dolly_speed * value * (1.0f / 60.0f)}; @@ -342,7 +342,7 @@ void nuptial_flight::enable_keeper_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); const math::quaternion yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {0.0f, 0.0f, dolly_speed * value * (1.0f / 60.0f)}; @@ -360,7 +360,7 @@ void nuptial_flight::enable_keeper_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); const math::quaternion yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {truck_speed * value * (1.0f / 60.0f), 0.0f, 0.0f}; @@ -378,7 +378,7 @@ void nuptial_flight::enable_keeper_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); const math::quaternion yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {-truck_speed * value * (1.0f / 60.0f), 0.0f, 0.0f}; @@ -452,7 +452,7 @@ void nuptial_flight::enable_keeper_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw += gamepad_pan_factor * value * (1.0f / 60.0f); } ); @@ -463,7 +463,7 @@ void nuptial_flight::enable_keeper_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw += mouse_pan_factor * value * (1.0f / 60.0f); } ); @@ -473,7 +473,7 @@ void nuptial_flight::enable_keeper_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw -= gamepad_pan_factor * value * (1.0f / 60.0f); } ); @@ -484,7 +484,7 @@ void nuptial_flight::enable_keeper_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw -= mouse_pan_factor * value * (1.0f / 60.0f); } ); @@ -493,7 +493,7 @@ void nuptial_flight::enable_keeper_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch -= gamepad_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::max(math::radians(-90.0f), three_dof.pitch); } @@ -505,7 +505,7 @@ void nuptial_flight::enable_keeper_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch -= mouse_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::max(math::radians(-90.0f), three_dof.pitch); } @@ -515,7 +515,7 @@ void nuptial_flight::enable_keeper_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch += gamepad_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::min(math::radians(90.0f), three_dof.pitch); } @@ -527,7 +527,7 @@ void nuptial_flight::enable_keeper_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch += mouse_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::min(math::radians(90.0f), three_dof.pitch); } @@ -775,7 +775,7 @@ void nuptial_flight::enable_ant_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& locomotion = ctx.entity_registry->get(ant_eid); + auto& locomotion = ctx.entity_registry->get(ant_eid); const math::quaternion yaw = math::angle_axis(locomotion.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {0.0f, 0.0f, move_forward_speed * value * (1.0f / 60.0f)}; @@ -793,7 +793,7 @@ void nuptial_flight::enable_ant_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& locomotion = ctx.entity_registry->get(ant_eid); + auto& locomotion = ctx.entity_registry->get(ant_eid); const math::quaternion yaw = math::angle_axis(locomotion.yaw, {0.0f, 1.0f, 0.0f}); const float3 movement = {0.0f, 0.0f, -move_back_speed * value * (1.0f / 60.0f)}; @@ -811,7 +811,7 @@ void nuptial_flight::enable_ant_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& locomotion = ctx.entity_registry->get(ant_eid); + auto& locomotion = ctx.entity_registry->get(ant_eid); float delta_yaw = -turn_speed * value * (1.0f / 60.0f); locomotion.yaw += delta_yaw; @@ -829,7 +829,7 @@ void nuptial_flight::enable_ant_controls() if (move_fast->is_active()) value *= fast_modifier; - auto& locomotion = ctx.entity_registry->get(ant_eid); + auto& locomotion = ctx.entity_registry->get(ant_eid); float delta_yaw = turn_speed * value * (1.0f / 60.0f); locomotion.yaw += delta_yaw; @@ -843,7 +843,7 @@ void nuptial_flight::enable_ant_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw += gamepad_pan_factor * value * (1.0f / 60.0f); } ); @@ -854,7 +854,7 @@ void nuptial_flight::enable_ant_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw += mouse_pan_factor * value * (1.0f / 60.0f); } ); @@ -864,7 +864,7 @@ void nuptial_flight::enable_ant_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw -= gamepad_pan_factor * value * (1.0f / 60.0f); } ); @@ -875,7 +875,7 @@ void nuptial_flight::enable_ant_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.yaw -= mouse_pan_factor * value * (1.0f / 60.0f); } ); @@ -884,7 +884,7 @@ void nuptial_flight::enable_ant_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch -= gamepad_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::max(math::radians(-90.0f), three_dof.pitch); } @@ -896,7 +896,7 @@ void nuptial_flight::enable_ant_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch -= mouse_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::max(math::radians(-90.0f), three_dof.pitch); } @@ -906,7 +906,7 @@ void nuptial_flight::enable_ant_controls() ( [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value) { - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch += gamepad_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::min(math::radians(90.0f), three_dof.pitch); } @@ -918,7 +918,7 @@ void nuptial_flight::enable_ant_controls() if (!ctx.mouse_look) return; - auto& three_dof = ctx.entity_registry->get(three_dof_eid); + auto& three_dof = ctx.entity_registry->get(three_dof_eid); three_dof.pitch += mouse_tilt_factor * value * (1.0f / 60.0f); three_dof.pitch = std::min(math::radians(90.0f), three_dof.pitch); } diff --git a/src/game/state/splash.cpp b/src/game/state/splash.cpp index 616c41d..fc412a5 100644 --- a/src/game/state/splash.cpp +++ b/src/game/state/splash.cpp @@ -19,6 +19,7 @@ #include "game/state/splash.hpp" #include "game/state/main-menu.hpp" +#include "game/state/nuptial-flight.hpp" #include "animation/screen-transition.hpp" #include "animation/animation.hpp" #include "animation/animator.hpp" @@ -116,7 +117,7 @@ splash::splash(game::context& ctx): [&ctx]() { ctx.state_machine.pop(); - ctx.state_machine.emplace(new game::state::main_menu(ctx, true)); + ctx.state_machine.emplace(new game::state::nuptial_flight(ctx)); } ); } @@ -144,7 +145,7 @@ splash::splash(game::context& ctx): // Change to main menu state ctx.state_machine.pop(); - ctx.state_machine.emplace(new game::state::main_menu(ctx, true)); + ctx.state_machine.emplace(new game::state::nuptial_flight(ctx)); } } ); diff --git a/src/entity/systems/astronomy.cpp b/src/game/system/astronomy.cpp similarity index 87% rename from src/entity/systems/astronomy.cpp rename to src/game/system/astronomy.cpp index 9085e2e..feffb41 100644 --- a/src/entity/systems/astronomy.cpp +++ b/src/game/system/astronomy.cpp @@ -17,11 +17,11 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/astronomy.hpp" +#include "game/system/astronomy.hpp" #include "astro/apparent-size.hpp" -#include "entity/components/blackbody.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/diffuse-reflector.hpp" +#include "game/component/blackbody.hpp" +#include "game/component/transform.hpp" +#include "game/component/diffuse-reflector.hpp" #include "geom/intersection.hpp" #include "geom/cartesian.hpp" #include "color/color.hpp" @@ -38,7 +38,7 @@ #include "math/polynomial.hpp" #include -namespace entity { +namespace game { namespace system { astronomy::astronomy(entity::registry& registry): @@ -64,34 +64,34 @@ astronomy::astronomy(entity::registry& registry): math::quaternion::rotate_x(-math::half_pi) }; - registry.on_construct().connect<&astronomy::on_observer_modified>(this); - registry.on_replace().connect<&astronomy::on_observer_modified>(this); - registry.on_destroy().connect<&astronomy::on_observer_destroyed>(this); - registry.on_construct().connect<&astronomy::on_celestial_body_modified>(this); - registry.on_replace().connect<&astronomy::on_celestial_body_modified>(this); - registry.on_destroy().connect<&astronomy::on_celestial_body_destroyed>(this); - registry.on_construct().connect<&astronomy::on_orbit_modified>(this); - registry.on_replace().connect<&astronomy::on_orbit_modified>(this); - registry.on_destroy().connect<&astronomy::on_orbit_destroyed>(this); - registry.on_construct().connect<&astronomy::on_atmosphere_modified>(this); - registry.on_replace().connect<&astronomy::on_atmosphere_modified>(this); - registry.on_destroy().connect<&astronomy::on_atmosphere_destroyed>(this); + registry.on_construct().connect<&astronomy::on_observer_modified>(this); + registry.on_replace().connect<&astronomy::on_observer_modified>(this); + registry.on_destroy().connect<&astronomy::on_observer_destroyed>(this); + registry.on_construct().connect<&astronomy::on_celestial_body_modified>(this); + registry.on_replace().connect<&astronomy::on_celestial_body_modified>(this); + registry.on_destroy().connect<&astronomy::on_celestial_body_destroyed>(this); + registry.on_construct().connect<&astronomy::on_orbit_modified>(this); + registry.on_replace().connect<&astronomy::on_orbit_modified>(this); + registry.on_destroy().connect<&astronomy::on_orbit_destroyed>(this); + registry.on_construct().connect<&astronomy::on_atmosphere_modified>(this); + registry.on_replace().connect<&astronomy::on_atmosphere_modified>(this); + registry.on_destroy().connect<&astronomy::on_atmosphere_destroyed>(this); } astronomy::~astronomy() { - registry.on_construct().disconnect<&astronomy::on_observer_modified>(this); - registry.on_replace().disconnect<&astronomy::on_observer_modified>(this); - registry.on_destroy().disconnect<&astronomy::on_observer_destroyed>(this); - registry.on_construct().disconnect<&astronomy::on_celestial_body_modified>(this); - registry.on_replace().disconnect<&astronomy::on_celestial_body_modified>(this); - registry.on_destroy().disconnect<&astronomy::on_celestial_body_destroyed>(this); - registry.on_construct().disconnect<&astronomy::on_orbit_modified>(this); - registry.on_replace().disconnect<&astronomy::on_orbit_modified>(this); - registry.on_destroy().disconnect<&astronomy::on_orbit_destroyed>(this); - registry.on_construct().disconnect<&astronomy::on_atmosphere_modified>(this); - registry.on_replace().disconnect<&astronomy::on_atmosphere_modified>(this); - registry.on_destroy().disconnect<&astronomy::on_atmosphere_destroyed>(this); + registry.on_construct().disconnect<&astronomy::on_observer_modified>(this); + registry.on_replace().disconnect<&astronomy::on_observer_modified>(this); + registry.on_destroy().disconnect<&astronomy::on_observer_destroyed>(this); + registry.on_construct().disconnect<&astronomy::on_celestial_body_modified>(this); + registry.on_replace().disconnect<&astronomy::on_celestial_body_modified>(this); + registry.on_destroy().disconnect<&astronomy::on_celestial_body_destroyed>(this); + registry.on_construct().disconnect<&astronomy::on_orbit_modified>(this); + registry.on_replace().disconnect<&astronomy::on_orbit_modified>(this); + registry.on_destroy().disconnect<&astronomy::on_orbit_destroyed>(this); + registry.on_construct().disconnect<&astronomy::on_atmosphere_modified>(this); + registry.on_replace().disconnect<&astronomy::on_atmosphere_modified>(this); + registry.on_destroy().disconnect<&astronomy::on_atmosphere_destroyed>(this); } void astronomy::update(double t, double dt) @@ -427,7 +427,7 @@ void astronomy::set_sky_pass(::render::sky_pass* pass) } } -void astronomy::on_observer_modified(entity::registry& registry, entity::id entity_id, entity::component::observer& component) +void astronomy::on_observer_modified(entity::registry& registry, entity::id entity_id, game::component::observer& component) { if (entity_id == observer_eid) observer_modified(); @@ -439,7 +439,7 @@ void astronomy::on_observer_destroyed(entity::registry& registry, entity::id ent observer_modified(); } -void astronomy::on_celestial_body_modified(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& component) +void astronomy::on_celestial_body_modified(entity::registry& registry, entity::id entity_id, game::component::celestial_body& component) { if (entity_id == reference_body_eid) reference_body_modified(); @@ -451,7 +451,7 @@ void astronomy::on_celestial_body_destroyed(entity::registry& registry, entity:: reference_body_modified(); } -void astronomy::on_orbit_modified(entity::registry& registry, entity::id entity_id, entity::component::orbit& component) +void astronomy::on_orbit_modified(entity::registry& registry, entity::id entity_id, game::component::orbit& component) { if (entity_id == reference_body_eid) reference_orbit_modified(); @@ -463,7 +463,7 @@ void astronomy::on_orbit_destroyed(entity::registry& registry, entity::id entity reference_orbit_modified(); } -void astronomy::on_atmosphere_modified(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component) +void astronomy::on_atmosphere_modified(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component) { if (entity_id == reference_body_eid) reference_atmosphere_modified(); @@ -542,7 +542,7 @@ void astronomy::reference_atmosphere_modified() } -void astronomy::update_bcbf_to_eus(const entity::component::observer& observer, const entity::component::celestial_body& body) +void astronomy::update_bcbf_to_eus(const game::component::observer& observer, const game::component::celestial_body& body) { // Construct BCBF to EUS transformation bcbf_to_eus = physics::orbit::frame::bcbf::to_enu @@ -553,7 +553,7 @@ void astronomy::update_bcbf_to_eus(const entity::component::observer& observer, ) * enu_to_eus; } -void astronomy::update_icrf_to_eus(const entity::component::celestial_body& body, const entity::component::orbit& orbit) +void astronomy::update_icrf_to_eus(const game::component::celestial_body& body, const game::component::orbit& orbit) { // Evaluate reference body orientation polynomials const double body_pole_ra = math::polynomial::horner(body.pole_ra.begin(), body.pole_ra.end(), time_centuries); @@ -587,7 +587,7 @@ void astronomy::update_icrf_to_eus(const entity::component::celestial_body& body } } -double3 astronomy::integrate_transmittance(const entity::component::observer& observer, const entity::component::celestial_body& body, const entity::component::atmosphere& atmosphere, geom::ray ray) const +double3 astronomy::integrate_transmittance(const game::component::observer& observer, const game::component::celestial_body& body, const game::component::atmosphere& atmosphere, geom::ray ray) const { double3 transmittance = {1, 1, 1}; @@ -625,4 +625,4 @@ double3 astronomy::integrate_transmittance(const entity::component::observer& ob } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/astronomy.hpp b/src/game/system/astronomy.hpp similarity index 81% rename from src/entity/systems/astronomy.hpp rename to src/game/system/astronomy.hpp index db08a94..d2ddb10 100644 --- a/src/entity/systems/astronomy.hpp +++ b/src/game/system/astronomy.hpp @@ -17,23 +17,23 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_ASTRONOMY_HPP -#define ANTKEEPER_ENTITY_SYSTEM_ASTRONOMY_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_ASTRONOMY_HPP +#define ANTKEEPER_GAME_SYSTEM_ASTRONOMY_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "entity/id.hpp" #include "scene/directional-light.hpp" #include "scene/ambient-light.hpp" #include "utility/fundamental-types.hpp" #include "math/se3.hpp" #include "render/passes/sky-pass.hpp" -#include "entity/components/observer.hpp" -#include "entity/components/atmosphere.hpp" -#include "entity/components/celestial-body.hpp" -#include "entity/components/orbit.hpp" +#include "game/component/observer.hpp" +#include "game/component/atmosphere.hpp" +#include "game/component/celestial-body.hpp" +#include "game/component/orbit.hpp" #include "geom/ray.hpp" -namespace entity { +namespace game { namespace system { /** @@ -91,13 +91,13 @@ public: void set_sky_pass(::render::sky_pass* pass); private: - void on_observer_modified(entity::registry& registry, entity::id entity_id, entity::component::observer& component); + void on_observer_modified(entity::registry& registry, entity::id entity_id, game::component::observer& component); void on_observer_destroyed(entity::registry& registry, entity::id entity_id); - void on_celestial_body_modified(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& component); + void on_celestial_body_modified(entity::registry& registry, entity::id entity_id, game::component::celestial_body& component); void on_celestial_body_destroyed(entity::registry& registry, entity::id entity_id); - void on_orbit_modified(entity::registry& registry, entity::id entity_id, entity::component::orbit& component); + void on_orbit_modified(entity::registry& registry, entity::id entity_id, game::component::orbit& component); void on_orbit_destroyed(entity::registry& registry, entity::id entity_id); - void on_atmosphere_modified(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component); + void on_atmosphere_modified(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component); void on_atmosphere_destroyed(entity::registry& registry, entity::id entity_id); /// Called each time the observer is modified. @@ -113,10 +113,10 @@ private: void reference_atmosphere_modified(); /// Updates the BCBF to EUS transformation. - void update_bcbf_to_eus(const entity::component::observer& observer, const entity::component::celestial_body& body); + void update_bcbf_to_eus(const game::component::observer& observer, const game::component::celestial_body& body); /// Updates the ICRF to EUS transformation. - void update_icrf_to_eus(const entity::component::celestial_body& body, const entity::component::orbit& orbit); + void update_icrf_to_eus(const game::component::celestial_body& body, const game::component::orbit& orbit); /** * Integrates a transmittance factor due to atmospheric extinction along a ray. @@ -126,7 +126,7 @@ private: * * @return Spectral transmittance factor. */ - double3 integrate_transmittance(const entity::component::observer& observer, const entity::component::celestial_body& body, const entity::component::atmosphere& atmosphere, geom::ray ray) const; + double3 integrate_transmittance(const game::component::observer& observer, const game::component::celestial_body& body, const game::component::atmosphere& atmosphere, geom::ray ray) const; /// Time since epoch, in days. double time_days; @@ -165,6 +165,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_ASTRONOMY_HPP +#endif // ANTKEEPER_GAME_SYSTEM_ASTRONOMY_HPP diff --git a/src/entity/systems/atmosphere.cpp b/src/game/system/atmosphere.cpp similarity index 87% rename from src/entity/systems/atmosphere.cpp rename to src/game/system/atmosphere.cpp index 4a16002..f37deb4 100644 --- a/src/entity/systems/atmosphere.cpp +++ b/src/game/system/atmosphere.cpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/atmosphere.hpp" +#include "game/system/atmosphere.hpp" #include "physics/gas/atmosphere.hpp" #include "physics/gas/ozone.hpp" #include "physics/number-density.hpp" -namespace entity { +namespace game { namespace system { atmosphere::atmosphere(entity::registry& registry): @@ -32,9 +32,9 @@ atmosphere::atmosphere(entity::registry& registry): atmosphere_component(nullptr), sky_pass(nullptr) { - registry.on_construct().connect<&atmosphere::on_atmosphere_construct>(this); - registry.on_replace().connect<&atmosphere::on_atmosphere_replace>(this); - registry.on_destroy().connect<&atmosphere::on_atmosphere_destroy>(this); + registry.on_construct().connect<&atmosphere::on_atmosphere_construct>(this); + registry.on_replace().connect<&atmosphere::on_atmosphere_replace>(this); + registry.on_destroy().connect<&atmosphere::on_atmosphere_destroy>(this); } void atmosphere::update(double t, double dt) @@ -67,7 +67,7 @@ void atmosphere::atmosphere_modified() return; // Get atmosphere component of the entity - entity::component::atmosphere& component = *atmosphere_component; + game::component::atmosphere& component = *atmosphere_component; // Calculate Rayleigh scattering coefficients const double rayleigh_density = physics::number_density(component.rayleigh_concentration); @@ -103,7 +103,7 @@ void atmosphere::update_sky_pass() if (!sky_pass || !atmosphere_component) return; - const entity::component::atmosphere& component = *atmosphere_component; + const game::component::atmosphere& component = *atmosphere_component; sky_pass->set_atmosphere_upper_limit(static_cast(component.upper_limit)); sky_pass->set_rayleigh_parameters(static_cast(component.rayleigh_scale_height), math::type_cast(component.rayleigh_scattering)); @@ -112,13 +112,13 @@ void atmosphere::update_sky_pass() sky_pass->set_airglow_illuminance(math::type_cast(component.airglow_illuminance)); } -void atmosphere::on_atmosphere_construct(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component) +void atmosphere::on_atmosphere_construct(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component) { atmosphere_component = &component; atmosphere_modified(); } -void atmosphere::on_atmosphere_replace(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component) +void atmosphere::on_atmosphere_replace(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component) { atmosphere_component = &component; atmosphere_modified(); @@ -130,4 +130,4 @@ void atmosphere::on_atmosphere_destroy(entity::registry& registry, entity::id en } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/atmosphere.hpp b/src/game/system/atmosphere.hpp similarity index 80% rename from src/entity/systems/atmosphere.hpp rename to src/game/system/atmosphere.hpp index 2ca28e7..63306e0 100644 --- a/src/entity/systems/atmosphere.hpp +++ b/src/game/system/atmosphere.hpp @@ -17,16 +17,16 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_ATMOSPHERE_HPP -#define ANTKEEPER_ENTITY_SYSTEM_ATMOSPHERE_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_ATMOSPHERE_HPP +#define ANTKEEPER_GAME_SYSTEM_ATMOSPHERE_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "entity/id.hpp" #include "utility/fundamental-types.hpp" -#include "entity/components/atmosphere.hpp" +#include "game/component/atmosphere.hpp" #include "render/passes/sky-pass.hpp" -namespace entity { +namespace game { namespace system { /** @@ -53,17 +53,17 @@ private: void atmosphere_modified(); void update_sky_pass(); - void on_atmosphere_construct(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component); - void on_atmosphere_replace(entity::registry& registry, entity::id entity_id, entity::component::atmosphere& component); + void on_atmosphere_construct(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component); + void on_atmosphere_replace(entity::registry& registry, entity::id entity_id, game::component::atmosphere& component); void on_atmosphere_destroy(entity::registry& registry, entity::id entity_id); double3 rgb_wavelengths; double3 rgb_ozone_cross_sections; - entity::component::atmosphere* atmosphere_component; + game::component::atmosphere* atmosphere_component; ::render::sky_pass* sky_pass; }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_ATMOSPHERE_HPP +#endif // ANTKEEPER_GAME_SYSTEM_ATMOSPHERE_HPP diff --git a/src/entity/systems/behavior.cpp b/src/game/system/behavior.cpp similarity index 89% rename from src/entity/systems/behavior.cpp rename to src/game/system/behavior.cpp index 7635516..b133353 100644 --- a/src/entity/systems/behavior.cpp +++ b/src/game/system/behavior.cpp @@ -17,11 +17,11 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/behavior.hpp" -#include "entity/components/behavior.hpp" +#include "game/system/behavior.hpp" +#include "game/component/behavior.hpp" #include "entity/id.hpp" -namespace entity { +namespace game { namespace system { behavior::behavior(entity::registry& registry): @@ -30,7 +30,7 @@ behavior::behavior(entity::registry& registry): void behavior::update(double t, double dt) { - ebt::context context; + entity::ebt::context context; context.registry = ®istry; registry.view().each( @@ -45,4 +45,4 @@ void behavior::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/behavior.hpp b/src/game/system/behavior.hpp similarity index 81% rename from src/entity/systems/behavior.hpp rename to src/game/system/behavior.hpp index 68aae7a..741ca78 100644 --- a/src/entity/systems/behavior.hpp +++ b/src/game/system/behavior.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_BEHAVIOR_HPP -#define ANTKEEPER_ENTITY_SYSTEM_BEHAVIOR_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_BEHAVIOR_HPP +#define ANTKEEPER_GAME_SYSTEM_BEHAVIOR_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class behavior: @@ -34,7 +34,7 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_BEHAVIOR_HPP +#endif // ANTKEEPER_GAME_SYSTEM_BEHAVIOR_HPP diff --git a/src/entity/systems/blackbody.cpp b/src/game/system/blackbody.cpp similarity index 82% rename from src/entity/systems/blackbody.cpp rename to src/game/system/blackbody.cpp index 7ba8fd7..7cd8f6f 100644 --- a/src/entity/systems/blackbody.cpp +++ b/src/game/system/blackbody.cpp @@ -17,13 +17,13 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/blackbody.hpp" +#include "game/system/blackbody.hpp" #include "color/color.hpp" #include "physics/light/blackbody.hpp" #include "physics/light/photometry.hpp" #include "math/quadrature.hpp" -namespace entity { +namespace game { namespace system { blackbody::blackbody(entity::registry& registry): @@ -34,11 +34,11 @@ blackbody::blackbody(entity::registry& registry): visible_wavelengths_nm.resize(780 - 280); std::iota(visible_wavelengths_nm.begin(), visible_wavelengths_nm.end(), 280); - registry.on_construct().connect<&blackbody::on_blackbody_construct>(this); - registry.on_replace().connect<&blackbody::on_blackbody_replace>(this); + registry.on_construct().connect<&blackbody::on_blackbody_construct>(this); + registry.on_replace().connect<&blackbody::on_blackbody_replace>(this); - registry.on_construct().connect<&blackbody::on_celestial_body_construct>(this); - registry.on_replace().connect<&blackbody::on_celestial_body_replace>(this); + registry.on_construct().connect<&blackbody::on_celestial_body_construct>(this); + registry.on_replace().connect<&blackbody::on_celestial_body_replace>(this); } void blackbody::update(double t, double dt) @@ -92,25 +92,25 @@ void blackbody::update_luminance(entity::id entity_id) blackbody.luminance = math::quadrature::simpson(rgb_luminance, visible_wavelengths_nm.begin(), visible_wavelengths_nm.end()); } -void blackbody::on_blackbody_construct(entity::registry& registry, entity::id entity_id, entity::component::blackbody& blackbody) +void blackbody::on_blackbody_construct(entity::registry& registry, entity::id entity_id, game::component::blackbody& blackbody) { update_luminance(entity_id); } -void blackbody::on_blackbody_replace(entity::registry& registry, entity::id entity_id, entity::component::blackbody& blackbody) +void blackbody::on_blackbody_replace(entity::registry& registry, entity::id entity_id, game::component::blackbody& blackbody) { update_luminance(entity_id); } -void blackbody::on_celestial_body_construct(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& celestial_body) +void blackbody::on_celestial_body_construct(entity::registry& registry, entity::id entity_id, game::component::celestial_body& celestial_body) { update_luminance(entity_id); } -void blackbody::on_celestial_body_replace(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& celestial_body) +void blackbody::on_celestial_body_replace(entity::registry& registry, entity::id entity_id, game::component::celestial_body& celestial_body) { update_luminance(entity_id); } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/blackbody.hpp b/src/game/system/blackbody.hpp similarity index 75% rename from src/entity/systems/blackbody.hpp rename to src/game/system/blackbody.hpp index b38eb75..5cb63c0 100644 --- a/src/entity/systems/blackbody.hpp +++ b/src/game/system/blackbody.hpp @@ -17,17 +17,17 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_BLACKBODY_HPP -#define ANTKEEPER_ENTITY_SYSTEM_BLACKBODY_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_BLACKBODY_HPP +#define ANTKEEPER_GAME_SYSTEM_BLACKBODY_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "entity/id.hpp" #include "utility/fundamental-types.hpp" -#include "entity/components/blackbody.hpp" -#include "entity/components/celestial-body.hpp" +#include "game/component/blackbody.hpp" +#include "game/component/celestial-body.hpp" #include -namespace entity { +namespace game { namespace system { /** @@ -51,17 +51,17 @@ public: private: void update_luminance(entity::id entity_id); - void on_blackbody_construct(entity::registry& registry, entity::id entity_id, entity::component::blackbody& blackbody); - void on_blackbody_replace(entity::registry& registry, entity::id entity_id, entity::component::blackbody& blackbody); + void on_blackbody_construct(entity::registry& registry, entity::id entity_id, game::component::blackbody& blackbody); + void on_blackbody_replace(entity::registry& registry, entity::id entity_id, game::component::blackbody& blackbody); - void on_celestial_body_construct(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& celestial_body); - void on_celestial_body_replace(entity::registry& registry, entity::id entity_id, entity::component::celestial_body& celestial_body); + void on_celestial_body_construct(entity::registry& registry, entity::id entity_id, game::component::celestial_body& celestial_body); + void on_celestial_body_replace(entity::registry& registry, entity::id entity_id, game::component::celestial_body& celestial_body); math::vector2 illuminant; std::vector visible_wavelengths_nm; }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_BLACKBODY_HPP +#endif // ANTKEEPER_GAME_SYSTEM_BLACKBODY_HPP diff --git a/src/entity/systems/camera.cpp b/src/game/system/camera.cpp similarity index 96% rename from src/entity/systems/camera.cpp rename to src/game/system/camera.cpp index 2882b4f..ffa2da0 100644 --- a/src/entity/systems/camera.cpp +++ b/src/game/system/camera.cpp @@ -19,7 +19,7 @@ #include "camera.hpp" -namespace entity { +namespace game { namespace system { camera::camera(entity::registry& registry): @@ -43,4 +43,4 @@ void camera::handle_event(const window_resized_event& event) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/camera.hpp b/src/game/system/camera.hpp similarity index 85% rename from src/entity/systems/camera.hpp rename to src/game/system/camera.hpp index 1cdb9fe..dacbd25 100644 --- a/src/entity/systems/camera.hpp +++ b/src/game/system/camera.hpp @@ -17,16 +17,16 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_CAMERA_HPP -#define ANTKEEPER_ENTITY_SYSTEM_CAMERA_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_CAMERA_HPP +#define ANTKEEPER_GAME_SYSTEM_CAMERA_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "event/event-handler.hpp" #include "event/input-events.hpp" #include "event/window-events.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace system { class camera: @@ -46,7 +46,7 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_CAMERA_HPP +#endif // ANTKEEPER_GAME_SYSTEM_CAMERA_HPP diff --git a/src/entity/systems/collision.cpp b/src/game/system/collision.cpp similarity index 95% rename from src/entity/systems/collision.cpp rename to src/game/system/collision.cpp index 6d2b8de..de8559a 100644 --- a/src/entity/systems/collision.cpp +++ b/src/game/system/collision.cpp @@ -18,9 +18,9 @@ */ #include "collision.hpp" -#include "entity/components/transform.hpp" +#include "game/component/transform.hpp" -namespace entity { +namespace game { namespace system { collision::collision(entity::registry& registry): @@ -44,4 +44,4 @@ void collision::on_collision_destroy(entity::registry& registry, entity::id enti {} } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/collision.hpp b/src/game/system/collision.hpp similarity index 78% rename from src/entity/systems/collision.hpp rename to src/game/system/collision.hpp index 8d81a00..42dc046 100644 --- a/src/entity/systems/collision.hpp +++ b/src/game/system/collision.hpp @@ -17,14 +17,14 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_COLLISION_HPP -#define ANTKEEPER_ENTITY_SYSTEM_COLLISION_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_COLLISION_HPP +#define ANTKEEPER_GAME_SYSTEM_COLLISION_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "entity/id.hpp" -#include "entity/components/collision.hpp" +#include "game/component/collision.hpp" -namespace entity { +namespace game { namespace system { /** @@ -37,13 +37,13 @@ public: virtual void update(double t, double dt); private: - void on_collision_construct(entity::registry& registry, entity::id entity_id, entity::component::collision& collision); - void on_collision_replace(entity::registry& registry, entity::id entity_id, entity::component::collision& collision); + void on_collision_construct(entity::registry& registry, entity::id entity_id, game::component::collision& collision); + void on_collision_replace(entity::registry& registry, entity::id entity_id, game::component::collision& collision); void on_collision_destroy(entity::registry& registry, entity::id entity_id); }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_COLLISION_HPP +#endif // ANTKEEPER_GAME_SYSTEM_COLLISION_HPP diff --git a/src/entity/systems/constraint.cpp b/src/game/system/constraint.cpp similarity index 97% rename from src/entity/systems/constraint.cpp rename to src/game/system/constraint.cpp index 371977a..8681490 100644 --- a/src/entity/systems/constraint.cpp +++ b/src/game/system/constraint.cpp @@ -18,11 +18,11 @@ */ #include "constraint.hpp" -#include "entity/components/constraint-stack.hpp" -#include "entity/components/constraints/constraints.hpp" -#include "entity/components/transform.hpp" +#include "game/component/constraint-stack.hpp" +#include "game/component/constraints/constraints.hpp" +#include "game/component/transform.hpp" -namespace entity { +namespace game { namespace system { constraint::constraint(entity::registry& registry): @@ -204,4 +204,4 @@ void constraint::handle_spring_to_constraint(component::transform& transform, en } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/constraint.hpp b/src/game/system/constraint.hpp similarity index 82% rename from src/entity/systems/constraint.hpp rename to src/game/system/constraint.hpp index 38731ef..c3e7fd7 100644 --- a/src/entity/systems/constraint.hpp +++ b/src/game/system/constraint.hpp @@ -17,22 +17,22 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_CONSTRAINT_HPP -#define ANTKEEPER_ENTITY_SYSTEM_CONSTRAINT_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_CONSTRAINT_HPP +#define ANTKEEPER_GAME_SYSTEM_CONSTRAINT_HPP -#include "entity/systems/updatable.hpp" -#include "entity/components/transform.hpp" +#include "game/system/updatable.hpp" +#include "game/component/transform.hpp" #include "entity/id.hpp" -namespace entity { +namespace game { namespace system { /** * Applies constraint stacks to transform components. * - * @see entity::component::constraint_stack - * @see entity::component::constraint_stack_node - * @see entity::component::constraint + * @see game::component::constraint_stack + * @see game::component::constraint_stack_node + * @see game::component::constraint */ class constraint: public updatable @@ -54,6 +54,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_CONSTRAINT_HPP +#endif // ANTKEEPER_GAME_SYSTEM_CONSTRAINT_HPP diff --git a/src/entity/systems/locomotion.cpp b/src/game/system/locomotion.cpp similarity index 86% rename from src/entity/systems/locomotion.cpp rename to src/game/system/locomotion.cpp index c1e3214..fd78d09 100644 --- a/src/entity/systems/locomotion.cpp +++ b/src/game/system/locomotion.cpp @@ -18,12 +18,12 @@ */ #include "locomotion.hpp" -#include "entity/components/collision.hpp" -#include "entity/components/locomotion.hpp" -#include "entity/components/transform.hpp" +#include "game/component/collision.hpp" +#include "game/component/locomotion.hpp" +#include "game/component/transform.hpp" #include "entity/id.hpp" -namespace entity { +namespace game { namespace system { locomotion::locomotion(entity::registry& registry): @@ -39,4 +39,4 @@ void locomotion::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/locomotion.hpp b/src/game/system/locomotion.hpp similarity index 81% rename from src/entity/systems/locomotion.hpp rename to src/game/system/locomotion.hpp index 7b55740..82bb1e3 100644 --- a/src/entity/systems/locomotion.hpp +++ b/src/game/system/locomotion.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_LOCOMOTION_HPP -#define ANTKEEPER_ENTITY_SYSTEM_LOCOMOTION_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_LOCOMOTION_HPP +#define ANTKEEPER_GAME_SYSTEM_LOCOMOTION_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class locomotion: @@ -34,6 +34,6 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_LOCOMOTION_HPP +#endif // ANTKEEPER_GAME_SYSTEM_LOCOMOTION_HPP diff --git a/src/entity/systems/morphogenesis.cpp b/src/game/system/morphogenesis.cpp similarity index 92% rename from src/entity/systems/morphogenesis.cpp rename to src/game/system/morphogenesis.cpp index fa6da0e..41c076c 100644 --- a/src/entity/systems/morphogenesis.cpp +++ b/src/game/system/morphogenesis.cpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/morphogenesis.hpp" +#include "game/system/morphogenesis.hpp" #include "entity/id.hpp" -namespace entity { +namespace game { namespace system { morphogenesis::morphogenesis(entity::registry& registry): @@ -31,4 +31,4 @@ void morphogenesis::update(double t, double dt) {} } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/morphogenesis.hpp b/src/game/system/morphogenesis.hpp similarity index 88% rename from src/entity/systems/morphogenesis.hpp rename to src/game/system/morphogenesis.hpp index 86fbbc5..be52236 100644 --- a/src/entity/systems/morphogenesis.hpp +++ b/src/game/system/morphogenesis.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_MORPHOGENESIS_HPP -#define ANTKEEPER_ENTITY_SYSTEM_MORPHOGENESIS_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_MORPHOGENESIS_HPP +#define ANTKEEPER_GAME_SYSTEM_MORPHOGENESIS_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { /** @@ -55,6 +55,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_MORPHOGENESIS_HPP +#endif // ANTKEEPER_GAME_SYSTEM_MORPHOGENESIS_HPP diff --git a/src/entity/systems/orbit.cpp b/src/game/system/orbit.cpp similarity index 80% rename from src/entity/systems/orbit.cpp rename to src/game/system/orbit.cpp index 8bfa9d5..2d4bf59 100644 --- a/src/entity/systems/orbit.cpp +++ b/src/game/system/orbit.cpp @@ -17,11 +17,11 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/orbit.hpp" +#include "game/system/orbit.hpp" #include "physics/orbit/orbit.hpp" #include -namespace entity { +namespace game { namespace system { orbit::orbit(entity::registry& registry): @@ -30,14 +30,14 @@ orbit::orbit(entity::registry& registry): time(0.0), time_scale(1.0) { - registry.on_construct().connect<&orbit::on_orbit_construct>(this); - registry.on_replace().connect<&orbit::on_orbit_replace>(this); + registry.on_construct().connect<&orbit::on_orbit_construct>(this); + registry.on_replace().connect<&orbit::on_orbit_replace>(this); } orbit::~orbit() { - registry.on_construct().disconnect<&orbit::on_orbit_construct>(this); - registry.on_replace().disconnect<&orbit::on_orbit_replace>(this); + registry.on_construct().disconnect<&orbit::on_orbit_construct>(this); + registry.on_replace().disconnect<&orbit::on_orbit_replace>(this); } void orbit::update(double t, double dt) @@ -84,15 +84,15 @@ void orbit::set_time_scale(double scale) time_scale = scale; } -void orbit::on_orbit_construct(entity::registry& registry, entity::id entity_id, entity::component::orbit& component) +void orbit::on_orbit_construct(entity::registry& registry, entity::id entity_id, game::component::orbit& component) { ephemeris_indices.insert(component.ephemeris_index); } -void orbit::on_orbit_replace(entity::registry& registry, entity::id entity_id, entity::component::orbit& component) +void orbit::on_orbit_replace(entity::registry& registry, entity::id entity_id, game::component::orbit& component) { ephemeris_indices.insert(component.ephemeris_index); } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/orbit.hpp b/src/game/system/orbit.hpp similarity index 86% rename from src/entity/systems/orbit.hpp rename to src/game/system/orbit.hpp index a08f9cb..3b5e560 100644 --- a/src/entity/systems/orbit.hpp +++ b/src/game/system/orbit.hpp @@ -17,17 +17,17 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_SOLAR_HPP -#define ANTKEEPER_ENTITY_SYSTEM_SOLAR_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_SOLAR_HPP +#define ANTKEEPER_GAME_SYSTEM_SOLAR_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "utility/fundamental-types.hpp" #include "entity/id.hpp" -#include "entity/components/orbit.hpp" +#include "game/component/orbit.hpp" #include "physics/orbit/ephemeris.hpp" #include -namespace entity { +namespace game { namespace system { /** @@ -70,8 +70,8 @@ public: void set_ephemeris(const physics::orbit::ephemeris* ephemeris); private: - void on_orbit_construct(entity::registry& registry, entity::id entity_id, entity::component::orbit& component); - void on_orbit_replace(entity::registry& registry, entity::id entity_id, entity::component::orbit& component); + void on_orbit_construct(entity::registry& registry, entity::id entity_id, game::component::orbit& component); + void on_orbit_replace(entity::registry& registry, entity::id entity_id, game::component::orbit& component); const physics::orbit::ephemeris* ephemeris; double time; @@ -81,6 +81,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_SOLAR_HPP +#endif // ANTKEEPER_GAME_SYSTEM_SOLAR_HPP diff --git a/src/entity/systems/painting.cpp b/src/game/system/painting.cpp similarity index 98% rename from src/entity/systems/painting.cpp rename to src/game/system/painting.cpp index 5db2291..03c9558 100644 --- a/src/entity/systems/painting.cpp +++ b/src/game/system/painting.cpp @@ -18,9 +18,9 @@ */ #include "painting.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/brush.hpp" -#include "entity/components/tool.hpp" +#include "game/component/transform.hpp" +#include "game/component/brush.hpp" +#include "game/component/tool.hpp" #include "event/event-dispatcher.hpp" #include "resources/resource-manager.hpp" #include "math/math.hpp" @@ -28,14 +28,14 @@ #include "render/model.hpp" #include "utility/fundamental-types.hpp" #include "entity/commands.hpp" -#include "entity/components/collision.hpp" -#include "entity/components/transform.hpp" +#include "game/component/collision.hpp" +#include "game/component/transform.hpp" #include "gl/vertex-buffer.hpp" #include "render/vertex-attribute.hpp" #include "geom/mesh-functions.hpp" #include -namespace entity { +namespace game { namespace system { painting::painting(entity::registry& registry, ::event_dispatcher* event_dispatcher, ::resource_manager* resource_manager): @@ -370,4 +370,4 @@ std::optional> painting::cast_ray(const float3& posit } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/painting.hpp b/src/game/system/painting.hpp similarity index 91% rename from src/entity/systems/painting.hpp rename to src/game/system/painting.hpp index 20c822c..a0e4bd8 100644 --- a/src/entity/systems/painting.hpp +++ b/src/game/system/painting.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_PAINTING_HPP -#define ANTKEEPER_ENTITY_SYSTEM_PAINTING_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_PAINTING_HPP +#define ANTKEEPER_GAME_SYSTEM_PAINTING_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "entity/id.hpp" #include "event/event-handler.hpp" #include "game/events/tool-events.hpp" @@ -35,7 +35,7 @@ class event_dispatcher; class resource_manager; -namespace entity { +namespace game { namespace system { class painting: public updatable, @@ -89,6 +89,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_PAINTING_HPP +#endif // ANTKEEPER_GAME_SYSTEM_PAINTING_HPP diff --git a/src/entity/systems/proteome.cpp b/src/game/system/proteome.cpp similarity index 78% rename from src/entity/systems/proteome.cpp rename to src/game/system/proteome.cpp index 73bde69..8ec5416 100644 --- a/src/entity/systems/proteome.cpp +++ b/src/game/system/proteome.cpp @@ -17,33 +17,33 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/proteome.hpp" -#include "entity/components/proteome.hpp" +#include "game/system/proteome.hpp" +#include "game/component/proteome.hpp" #include "genetics/sequence.hpp" #include "genetics/standard-code.hpp" -namespace entity { +namespace game { namespace system { proteome::proteome(entity::registry& registry): updatable(registry) { - registry.on_construct().connect<&proteome::on_genome_construct>(this); - registry.on_replace().connect<&proteome::on_genome_replace>(this); + registry.on_construct().connect<&proteome::on_genome_construct>(this); + registry.on_replace().connect<&proteome::on_genome_replace>(this); } void proteome::update(double t, double dt) {} -void proteome::on_genome_construct(entity::registry& registry, entity::id entity_id, entity::component::genome& genome) +void proteome::on_genome_construct(entity::registry& registry, entity::id entity_id, game::component::genome& genome) { on_genome_replace(registry, entity_id, genome); } -void proteome::on_genome_replace(entity::registry& registry, entity::id entity_id, entity::component::genome& genome) +void proteome::on_genome_replace(entity::registry& registry, entity::id entity_id, game::component::genome& genome) { // Allocate a proteome component - entity::component::proteome proteome_component; + game::component::proteome proteome_component; // For each chromosome in the genome for (const std::string& chromosome: genome.chromosomes) @@ -67,8 +67,8 @@ void proteome::on_genome_replace(entity::registry& registry, entity::id entity_i } // Assign or replace the entity's proteome component - registry.assign_or_replace(entity_id, proteome_component); + registry.assign_or_replace(entity_id, proteome_component); } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/proteome.hpp b/src/game/system/proteome.hpp similarity index 79% rename from src/entity/systems/proteome.hpp rename to src/game/system/proteome.hpp index 567fbf4..34d7182 100644 --- a/src/entity/systems/proteome.hpp +++ b/src/game/system/proteome.hpp @@ -17,14 +17,14 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_PROTEOME_HPP -#define ANTKEEPER_ENTITY_SYSTEM_PROTEOME_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_PROTEOME_HPP +#define ANTKEEPER_GAME_SYSTEM_PROTEOME_HPP -#include "entity/systems/updatable.hpp" -#include "entity/components/genome.hpp" +#include "game/system/updatable.hpp" +#include "game/component/genome.hpp" #include "entity/id.hpp" -namespace entity { +namespace game { namespace system { /** @@ -45,11 +45,11 @@ public: virtual void update(double t, double dt); private: - void on_genome_construct(entity::registry& registry, entity::id entity_id, entity::component::genome& genome); - void on_genome_replace(entity::registry& registry, entity::id entity_id, entity::component::genome& genome); + void on_genome_construct(entity::registry& registry, entity::id entity_id, game::component::genome& genome); + void on_genome_replace(entity::registry& registry, entity::id entity_id, game::component::genome& genome); }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_PROTEOME_HPP +#endif // ANTKEEPER_GAME_SYSTEM_PROTEOME_HPP diff --git a/src/entity/systems/render.cpp b/src/game/system/render.cpp similarity index 97% rename from src/entity/systems/render.cpp rename to src/game/system/render.cpp index 77ae5ac..436987f 100644 --- a/src/entity/systems/render.cpp +++ b/src/game/system/render.cpp @@ -18,15 +18,15 @@ */ #include "render.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/camera.hpp" +#include "game/component/transform.hpp" +#include "game/component/camera.hpp" #include "scene/point-light.hpp" #include "scene/directional-light.hpp" #include "scene/ambient-light.hpp" #include "scene/spot-light.hpp" #include -namespace entity { +namespace game { namespace system { render::render(entity::registry& registry): @@ -164,7 +164,7 @@ void render::update_model_and_materials(entity::id entity_id, component::model& } } -void render::update_light(entity::id entity_id, entity::component::light& component) +void render::update_light(entity::id entity_id, game::component::light& component) { if (auto light_it = lights.find(entity_id); light_it != lights.end()) { @@ -279,4 +279,4 @@ void render::on_light_destroy(entity::registry& registry, entity::id entity_id) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/render.hpp b/src/game/system/render.hpp similarity index 76% rename from src/entity/systems/render.hpp rename to src/game/system/render.hpp index b777e92..2b92d74 100644 --- a/src/entity/systems/render.hpp +++ b/src/game/system/render.hpp @@ -17,21 +17,21 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_RENDER_HPP -#define ANTKEEPER_ENTITY_SYSTEM_RENDER_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_RENDER_HPP +#define ANTKEEPER_GAME_SYSTEM_RENDER_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "scene/collection.hpp" #include "scene/model-instance.hpp" #include "scene/light.hpp" -#include "entity/components/model.hpp" -#include "entity/components/light.hpp" +#include "game/component/model.hpp" +#include "game/component/light.hpp" #include "entity/id.hpp" #include "render/renderer.hpp" #include #include -namespace entity { +namespace game { namespace system { class render: public updatable @@ -52,15 +52,15 @@ public: scene::light* get_light(entity::id entity_id); private: - void update_model_and_materials(entity::id entity_id, entity::component::model& model); - void update_light(entity::id entity_id, entity::component::light& component); + void update_model_and_materials(entity::id entity_id, game::component::model& model); + void update_light(entity::id entity_id, game::component::light& component); - void on_model_construct(entity::registry& registry, entity::id entity_id, entity::component::model& model); - void on_model_replace(entity::registry& registry, entity::id entity_id, entity::component::model& model); + void on_model_construct(entity::registry& registry, entity::id entity_id, game::component::model& model); + void on_model_replace(entity::registry& registry, entity::id entity_id, game::component::model& model); void on_model_destroy(entity::registry& registry, entity::id entity_id); - void on_light_construct(entity::registry& registry, entity::id entity_id, entity::component::light& light); - void on_light_replace(entity::registry& registry, entity::id entity_id, entity::component::light& light); + void on_light_construct(entity::registry& registry, entity::id entity_id, game::component::light& light); + void on_light_replace(entity::registry& registry, entity::id entity_id, game::component::light& light); void on_light_destroy(entity::registry& registry, entity::id entity_id); double t; @@ -72,7 +72,7 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_RENDER_HPP +#endif // ANTKEEPER_GAME_SYSTEM_RENDER_HPP diff --git a/src/entity/systems/samara.cpp b/src/game/system/samara.cpp similarity index 94% rename from src/entity/systems/samara.cpp rename to src/game/system/samara.cpp index c50c4ac..04855b1 100644 --- a/src/entity/systems/samara.cpp +++ b/src/game/system/samara.cpp @@ -18,13 +18,13 @@ */ #include "samara.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/samara.hpp" +#include "game/component/transform.hpp" +#include "game/component/samara.hpp" #include "entity/id.hpp" #include "math/math.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace system { samara::samara(entity::registry& registry): @@ -58,4 +58,4 @@ void samara::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/samara.hpp b/src/game/system/samara.hpp similarity index 81% rename from src/entity/systems/samara.hpp rename to src/game/system/samara.hpp index 5cefe7d..140bcc7 100644 --- a/src/entity/systems/samara.hpp +++ b/src/game/system/samara.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_SAMARA_HPP -#define ANTKEEPER_ENTITY_SYSTEM_SAMARA_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_SAMARA_HPP +#define ANTKEEPER_GAME_SYSTEM_SAMARA_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class samara: public updatable @@ -33,7 +33,7 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_SAMARA_HPP +#endif // ANTKEEPER_GAME_SYSTEM_SAMARA_HPP diff --git a/src/entity/systems/snapping.cpp b/src/game/system/snapping.cpp similarity index 94% rename from src/entity/systems/snapping.cpp rename to src/game/system/snapping.cpp index a379980..1bee797 100644 --- a/src/entity/systems/snapping.cpp +++ b/src/game/system/snapping.cpp @@ -18,13 +18,13 @@ */ #include "snapping.hpp" -#include "entity/components/collision.hpp" -#include "entity/components/snap.hpp" -#include "entity/components/transform.hpp" +#include "game/component/collision.hpp" +#include "game/component/snap.hpp" +#include "game/component/transform.hpp" #include "entity/id.hpp" #include "utility/fundamental-types.hpp" -namespace entity { +namespace game { namespace system { snapping::snapping(entity::registry& registry): @@ -90,4 +90,4 @@ void snapping::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/snapping.hpp b/src/game/system/snapping.hpp similarity index 81% rename from src/entity/systems/snapping.hpp rename to src/game/system/snapping.hpp index 67a1d9e..5ae180d 100644 --- a/src/entity/systems/snapping.hpp +++ b/src/game/system/snapping.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_SNAPPING_HPP -#define ANTKEEPER_ENTITY_SYSTEM_SNAPPING_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_SNAPPING_HPP +#define ANTKEEPER_GAME_SYSTEM_SNAPPING_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class snapping: @@ -34,7 +34,7 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_SNAPPING_HPP +#endif // ANTKEEPER_GAME_SYSTEM_SNAPPING_HPP diff --git a/src/entity/systems/spatial.cpp b/src/game/system/spatial.cpp similarity index 93% rename from src/entity/systems/spatial.cpp rename to src/game/system/spatial.cpp index 5fc8ca5..7539160 100644 --- a/src/entity/systems/spatial.cpp +++ b/src/game/system/spatial.cpp @@ -18,10 +18,10 @@ */ #include "spatial.hpp" -#include "entity/components/parent.hpp" -#include "entity/components/transform.hpp" +#include "game/component/parent.hpp" +#include "game/component/transform.hpp" -namespace entity { +namespace game { namespace system { spatial::spatial(entity::registry& registry): @@ -57,4 +57,4 @@ void spatial::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/spatial.hpp b/src/game/system/spatial.hpp similarity index 81% rename from src/entity/systems/spatial.hpp rename to src/game/system/spatial.hpp index 08e3e0b..6773106 100644 --- a/src/entity/systems/spatial.hpp +++ b/src/game/system/spatial.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_SPATIAL_HPP -#define ANTKEEPER_ENTITY_SYSTEM_SPATIAL_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_SPATIAL_HPP +#define ANTKEEPER_GAME_SYSTEM_SPATIAL_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class spatial: @@ -34,6 +34,6 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_SPATIAL_HPP +#endif // ANTKEEPER_GAME_SYSTEM_SPATIAL_HPP diff --git a/src/entity/systems/steering.cpp b/src/game/system/steering.cpp similarity index 94% rename from src/entity/systems/steering.cpp rename to src/game/system/steering.cpp index 94b0c07..203fb91 100644 --- a/src/entity/systems/steering.cpp +++ b/src/game/system/steering.cpp @@ -17,15 +17,15 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/steering.hpp" -#include "entity/components/steering.hpp" -#include "entity/components/transform.hpp" +#include "game/system/steering.hpp" +#include "game/component/steering.hpp" +#include "game/component/transform.hpp" #include "entity/id.hpp" #include "ai/steering/behavior/wander.hpp" #include "ai/steering/behavior/seek.hpp" #include "config.hpp" -namespace entity { +namespace game { namespace system { steering::steering(entity::registry& registry): @@ -90,4 +90,4 @@ void steering::update(double t, double dt) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/steering.hpp b/src/game/system/steering.hpp similarity index 81% rename from src/entity/systems/steering.hpp rename to src/game/system/steering.hpp index f48dc40..3ad13b1 100644 --- a/src/entity/systems/steering.hpp +++ b/src/game/system/steering.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_STEERING_HPP -#define ANTKEEPER_ENTITY_SYSTEM_STEERING_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_STEERING_HPP +#define ANTKEEPER_GAME_SYSTEM_STEERING_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" -namespace entity { +namespace game { namespace system { class steering: @@ -34,6 +34,6 @@ public: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_STEERING_HPP +#endif // ANTKEEPER_GAME_SYSTEM_STEERING_HPP diff --git a/src/entity/systems/subterrain.cpp b/src/game/system/subterrain.cpp similarity index 97% rename from src/entity/systems/subterrain.cpp rename to src/game/system/subterrain.cpp index aa5cab7..da4f3f5 100644 --- a/src/entity/systems/subterrain.cpp +++ b/src/game/system/subterrain.cpp @@ -18,8 +18,8 @@ */ #include "subterrain.hpp" -#include "entity/components/model.hpp" -#include "entity/components/cavity.hpp" +#include "game/component/model.hpp" +#include "game/component/cavity.hpp" #include "entity/id.hpp" #include "render/model.hpp" #include "render/material.hpp" @@ -35,7 +35,7 @@ #include #include -namespace entity { +namespace game { namespace system { /** @@ -272,7 +272,7 @@ subterrain::subterrain(entity::registry& registry, ::resource_manager* resource_ subterrain_model->set_bounds(subterrain_bounds); // Allocate cube tree - cube_tree = new entity::system::cube_tree(subterrain_bounds, octree_depth); + cube_tree = new game::system::cube_tree(subterrain_bounds, octree_depth); // Allocate mesh subterrain_mesh = new geom::mesh(); @@ -349,11 +349,11 @@ void subterrain::regenerate_subterrain_mesh() //std::cout << "creating mesh... done\n"; } -void subterrain::march(entity::system::cube_tree* node) +void subterrain::march(game::system::cube_tree* node) { if (!node->is_leaf()) { - for (entity::system::cube_tree* child: node->children) + for (game::system::cube_tree* child: node->children) march(child); return; } @@ -492,9 +492,9 @@ void subterrain::dig(const float3& position, float radius) cube_tree->subdivide_max(region); // Query all octree leaf nodes within the region - std::list nodes; + std::list nodes; cube_tree->visit_leaves(region, - [&position, radius](entity::system::cube_tree& node) + [&position, radius](game::system::cube_tree& node) { for (int i = 0; i < 8; ++i) { @@ -510,4 +510,4 @@ void subterrain::dig(const float3& position, float radius) } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/subterrain.hpp b/src/game/system/subterrain.hpp similarity index 94% rename from src/entity/systems/subterrain.hpp rename to src/game/system/subterrain.hpp index a32c1f3..4e1c066 100644 --- a/src/entity/systems/subterrain.hpp +++ b/src/game/system/subterrain.hpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_SUBTERRAIN_HPP -#define ANTKEEPER_ENTITY_SYSTEM_SUBTERRAIN_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_SUBTERRAIN_HPP +#define ANTKEEPER_GAME_SYSTEM_SUBTERRAIN_HPP -#include "entity/systems/updatable.hpp" +#include "game/system/updatable.hpp" #include "geom/mesh.hpp" #include "geom/aabb.hpp" #include "scene/collection.hpp" @@ -31,7 +31,7 @@ class resource_manager; -namespace entity { +namespace game { namespace system { struct cube_tree; @@ -128,7 +128,7 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_SUBTERRAIN_HPP +#endif // ANTKEEPER_GAME_SYSTEM_SUBTERRAIN_HPP diff --git a/src/entity/systems/terrain.cpp b/src/game/system/terrain.cpp similarity index 98% rename from src/entity/systems/terrain.cpp rename to src/game/system/terrain.cpp index 0664242..6a2e53d 100644 --- a/src/entity/systems/terrain.cpp +++ b/src/game/system/terrain.cpp @@ -17,10 +17,10 @@ * along with Antkeeper source code. If not, see . */ -#include "entity/systems/terrain.hpp" -#include "entity/components/celestial-body.hpp" -#include "entity/components/observer.hpp" -#include "entity/components/terrain.hpp" +#include "game/system/terrain.hpp" +#include "game/component/celestial-body.hpp" +#include "game/component/observer.hpp" +#include "game/component/terrain.hpp" #include "geom/meshes/grid.hpp" #include "geom/mesh-functions.hpp" #include "geom/morton.hpp" @@ -34,7 +34,7 @@ #include #include -namespace entity { +namespace game { namespace system { terrain::terrain(entity::registry& registry): @@ -568,4 +568,4 @@ double terrain::screen_space_error(double horizontal_fov, double horizontal_reso } } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/terrain.hpp b/src/game/system/terrain.hpp similarity index 92% rename from src/entity/systems/terrain.hpp rename to src/game/system/terrain.hpp index 8d89631..b3c57d9 100644 --- a/src/entity/systems/terrain.hpp +++ b/src/game/system/terrain.hpp @@ -17,11 +17,11 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_TERRAIN_HPP -#define ANTKEEPER_ENTITY_SYSTEM_TERRAIN_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_TERRAIN_HPP +#define ANTKEEPER_GAME_SYSTEM_TERRAIN_HPP -#include "entity/systems/updatable.hpp" -#include "entity/components/terrain.hpp" +#include "game/system/updatable.hpp" +#include "game/component/terrain.hpp" #include "entity/id.hpp" #include "math/quaternion-type.hpp" #include "geom/quadtree.hpp" @@ -33,7 +33,7 @@ #include "scene/collection.hpp" #include -namespace entity { +namespace game { namespace system { /** @@ -101,7 +101,7 @@ private: static double screen_space_error(double horizontal_fov, double horizontal_resolution, double distance, double geometric_error); - void on_terrain_construct(entity::registry& registry, entity::id entity_id, entity::component::terrain& component); + void on_terrain_construct(entity::registry& registry, entity::id entity_id, game::component::terrain& component); void on_terrain_destroy(entity::registry& registry, entity::id entity_id); /** @@ -132,6 +132,6 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_TERRAIN_HPP +#endif // ANTKEEPER_GAME_SYSTEM_TERRAIN_HPP diff --git a/src/entity/systems/updatable.cpp b/src/game/system/updatable.cpp similarity index 95% rename from src/entity/systems/updatable.cpp rename to src/game/system/updatable.cpp index 4e6b33a..01fa519 100644 --- a/src/entity/systems/updatable.cpp +++ b/src/game/system/updatable.cpp @@ -19,7 +19,7 @@ #include "updatable.hpp" -namespace entity { +namespace game { namespace system { updatable::updatable(entity::registry& registry): @@ -27,4 +27,4 @@ updatable::updatable(entity::registry& registry): {} } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/updatable.hpp b/src/game/system/updatable.hpp similarity index 88% rename from src/entity/systems/updatable.hpp rename to src/game/system/updatable.hpp index 91e9c10..ede0aa8 100644 --- a/src/entity/systems/updatable.hpp +++ b/src/game/system/updatable.hpp @@ -17,12 +17,12 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_UPDATABLE_HPP -#define ANTKEEPER_ENTITY_SYSTEM_UPDATABLE_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_UPDATABLE_HPP +#define ANTKEEPER_GAME_SYSTEM_UPDATABLE_HPP #include "entity/registry.hpp" -namespace entity { +namespace game { namespace system { /** @@ -53,6 +53,6 @@ protected: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_UPDATABLE_HPP +#endif // ANTKEEPER_GAME_SYSTEM_UPDATABLE_HPP diff --git a/src/entity/systems/vegetation.cpp b/src/game/system/vegetation.cpp similarity index 95% rename from src/entity/systems/vegetation.cpp rename to src/game/system/vegetation.cpp index c3c7ae9..dbf9f77 100644 --- a/src/entity/systems/vegetation.cpp +++ b/src/game/system/vegetation.cpp @@ -18,8 +18,8 @@ */ #include "vegetation.hpp" -#include "entity/components/model.hpp" -#include "entity/components/transform.hpp" +#include "game/component/model.hpp" +#include "game/component/transform.hpp" #include "scene/model-instance.hpp" #include "scene/lod-group.hpp" #include "scene/collection.hpp" @@ -28,7 +28,7 @@ #include "utility/fundamental-types.hpp" #include -namespace entity { +namespace game { namespace system { vegetation::vegetation(entity::registry& registry): @@ -86,4 +86,4 @@ void vegetation::on_terrain_destroy(entity::registry& registry, entity::id entit {} } // namespace system -} // namespace entity +} // namespace game diff --git a/src/entity/systems/vegetation.hpp b/src/game/system/vegetation.hpp similarity index 85% rename from src/entity/systems/vegetation.hpp rename to src/game/system/vegetation.hpp index e6b5215..f965fc8 100644 --- a/src/entity/systems/vegetation.hpp +++ b/src/game/system/vegetation.hpp @@ -17,17 +17,17 @@ * along with Antkeeper source code. If not, see . */ -#ifndef ANTKEEPER_ENTITY_SYSTEM_VEGETATION_HPP -#define ANTKEEPER_ENTITY_SYSTEM_VEGETATION_HPP +#ifndef ANTKEEPER_GAME_SYSTEM_VEGETATION_HPP +#define ANTKEEPER_GAME_SYSTEM_VEGETATION_HPP -#include "entity/systems/updatable.hpp" -#include "entity/components/terrain.hpp" +#include "game/system/updatable.hpp" +#include "game/component/terrain.hpp" #include "entity/id.hpp" #include "scene/collection.hpp" class model; -namespace entity { +namespace game { namespace system { /** @@ -61,7 +61,7 @@ public: void set_scene(scene::collection* collection); private: - void on_terrain_construct(entity::registry& registry, entity::id entity_id, entity::component::terrain& component); + void on_terrain_construct(entity::registry& registry, entity::id entity_id, game::component::terrain& component); void on_terrain_destroy(entity::registry& registry, entity::id entity_id); float terrain_patch_size; @@ -74,7 +74,7 @@ private: }; } // namespace system -} // namespace entity +} // namespace game -#endif // ANTKEEPER_ENTITY_SYSTEM_VEGETATION_HPP +#endif // ANTKEEPER_GAME_SYSTEM_VEGETATION_HPP diff --git a/src/game/tools.cpp b/src/game/tools.cpp index 14e794e..9916a5d 100644 --- a/src/game/tools.cpp +++ b/src/game/tools.cpp @@ -21,8 +21,8 @@ #include "application.hpp" #include "animation/animator.hpp" #include "animation/animation.hpp" -#include "entity/components/tool.hpp" -#include "entity/components/celestial-body.hpp" +#include "game/component/tool.hpp" +#include "game/component/celestial-body.hpp" #include "utility/timestamp.hpp" #include "render/material.hpp" #include "game/graphics.hpp" @@ -35,7 +35,7 @@ entity::id build_camera_tool(game::context& ctx) entity::id tool_eid = ctx.entity_registry->create(); // Create tool component - entity::component::tool tool; + game::component::tool tool; // Setup tool activated callback tool.activated = [&ctx]() @@ -74,7 +74,7 @@ entity::id build_camera_tool(game::context& ctx) }; // Add tool component to camera tool entity - ctx.entity_registry->assign(tool_eid, tool); + ctx.entity_registry->assign(tool_eid, tool); return tool_eid; } @@ -85,7 +85,7 @@ entity::id build_time_tool(game::context& ctx) entity::id tool_eid = ctx.entity_registry->create(); // Create tool component - entity::component::tool tool; + game::component::tool tool; // Setup tool active calback tool.active = [&ctx]() @@ -94,13 +94,13 @@ entity::id build_time_tool(game::context& ctx) //auto window = ctx.app->get_viewport_dimensions(); entity::id planet_eid = ctx.entities["planet"]; - entity::component::celestial_body body = ctx.entity_registry->get(planet_eid); + game::component::celestial_body body = ctx.entity_registry->get(planet_eid); //body.axial_rotation = math::radians(360.0f) * ((float)mouse_x / (float)window_w); - ctx.entity_registry->replace(planet_eid, body); + ctx.entity_registry->replace(planet_eid, body); }; // Add tool component to time tool entity - ctx.entity_registry->assign(tool_eid, tool); + ctx.entity_registry->assign(tool_eid, tool); return tool_eid; } diff --git a/src/game/world.cpp b/src/game/world.cpp index b9964fe..d3d1b67 100644 --- a/src/game/world.cpp +++ b/src/game/world.cpp @@ -21,15 +21,15 @@ #include "scene/text.hpp" #include "physics/light/vmag.hpp" #include "color/color.hpp" -#include "entity/components/atmosphere.hpp" -#include "entity/components/blackbody.hpp" -#include "entity/components/celestial-body.hpp" -#include "entity/components/orbit.hpp" -#include "entity/components/terrain.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/observer.hpp" -#include "entity/systems/astronomy.hpp" -#include "entity/systems/orbit.hpp" +#include "game/component/atmosphere.hpp" +#include "game/component/blackbody.hpp" +#include "game/component/celestial-body.hpp" +#include "game/component/orbit.hpp" +#include "game/component/terrain.hpp" +#include "game/component/transform.hpp" +#include "game/component/observer.hpp" +#include "game/system/astronomy.hpp" +#include "game/system/orbit.hpp" #include "entity/commands.hpp" #include "entity/archetype.hpp" #include "geom/spherical.hpp" @@ -101,7 +101,7 @@ void create_observer(game::context& ctx) ctx.entities["observer"] = observer_eid; // Construct observer component - entity::component::observer observer; + game::component::observer observer; // Set observer reference body if (auto it = ctx.entities.find("earth"); it != ctx.entities.end()) @@ -115,7 +115,7 @@ void create_observer(game::context& ctx) observer.longitude = 0.0; // Assign observer component to observer entity - ctx.entity_registry->assign(observer_eid, observer); + ctx.entity_registry->assign(observer_eid, observer); // Set astronomy system observer ctx.astronomy_system->set_observer(observer_eid); @@ -138,7 +138,7 @@ void set_location(game::context& ctx, double elevation, double latitude, double if (observer_eid != entt::null) { // Get pointer to observer component - const auto observer = ctx.entity_registry->try_get(observer_eid); + const auto observer = ctx.entity_registry->try_get(observer_eid); // Set observer location if (observer) @@ -146,11 +146,11 @@ void set_location(game::context& ctx, double elevation, double latitude, double observer->elevation = elevation; observer->latitude = latitude; observer->longitude = longitude; - ctx.entity_registry->replace(observer_eid, *observer); + ctx.entity_registry->replace(observer_eid, *observer); } /* - ctx.entity_registry->patch + ctx.entity_registry->patch ( observer_eid, [&](auto& component) @@ -191,7 +191,7 @@ void set_time(game::context& ctx, int year, int month, int day, int hour, int mi entity::id observer_eid = it->second; if (observer_eid != entt::null) { - const auto observer = ctx.entity_registry->try_get(observer_eid); + const auto observer = ctx.entity_registry->try_get(observer_eid); if (observer) longitude = observer->longitude; } @@ -485,10 +485,10 @@ void create_earth(game::context& ctx) ctx.entities["earth"] = earth_eid; // Assign orbital parent - ctx.entity_registry->get(earth_eid).parent = ctx.entities["em_bary"]; + ctx.entity_registry->get(earth_eid).parent = ctx.entities["em_bary"]; // Assign earth terrain component - entity::component::terrain terrain; + game::component::terrain terrain; terrain.elevation = [](double, double) -> double { //return math::random(0.0, 1.0); @@ -496,7 +496,7 @@ void create_earth(game::context& ctx) }; terrain.max_lod = 0; terrain.patch_material = nullptr; - //ctx.entity_registry->assign(earth_eid, terrain); + //ctx.entity_registry->assign(earth_eid, terrain); } catch (const std::exception&) { @@ -519,7 +519,7 @@ void create_moon(game::context& ctx) ctx.entities["moon"] = moon_eid; // Assign orbital parent - ctx.entity_registry->get(moon_eid).parent = ctx.entities["em_bary"]; + ctx.entity_registry->get(moon_eid).parent = ctx.entities["em_bary"]; // Pass moon model to sky pass ctx.sky_pass->set_moon_model(ctx.resource_manager->load("moon.mdl")); diff --git a/src/resources/entity-archetype-loader.cpp b/src/resources/entity-archetype-loader.cpp index d42e598..73276f6 100644 --- a/src/resources/entity-archetype-loader.cpp +++ b/src/resources/entity-archetype-loader.cpp @@ -20,16 +20,16 @@ #include "resource-loader.hpp" #include "resource-manager.hpp" #include "render/model.hpp" -#include "entity/components/atmosphere.hpp" -#include "entity/components/behavior.hpp" -#include "entity/components/collision.hpp" -#include "entity/components/diffuse-reflector.hpp" -#include "entity/components/terrain.hpp" -#include "entity/components/transform.hpp" -#include "entity/components/model.hpp" -#include "entity/components/orbit.hpp" -#include "entity/components/blackbody.hpp" -#include "entity/components/celestial-body.hpp" +#include "game/component/atmosphere.hpp" +#include "game/component/behavior.hpp" +#include "game/component/collision.hpp" +#include "game/component/diffuse-reflector.hpp" +#include "game/component/terrain.hpp" +#include "game/component/transform.hpp" +#include "game/component/model.hpp" +#include "game/component/orbit.hpp" +#include "game/component/blackbody.hpp" +#include "game/component/celestial-body.hpp" #include "entity/archetype.hpp" #include "entity/ebt.hpp" #include "physics/orbit/elements.hpp" @@ -38,7 +38,7 @@ static bool load_component_atmosphere(entity::archetype& archetype, const json& element) { - entity::component::atmosphere component; + game::component::atmosphere component; if (element.contains("upper_limit")) component.upper_limit = element["upper_limit"].get(); @@ -76,14 +76,14 @@ static bool load_component_atmosphere(entity::archetype& archetype, const json& component.airglow_illuminance.z = airglow_illuminance[2].get(); } - archetype.set(component); + archetype.set(component); return true; } static bool load_component_behavior(entity::archetype& archetype, resource_manager& resource_manager, const json& element) { - entity::component::behavior component; + game::component::behavior component; component.behavior_tree = nullptr; if (element.contains("file")) @@ -91,27 +91,27 @@ static bool load_component_behavior(entity::archetype& archetype, resource_manag component.behavior_tree = resource_manager.load(element["file"].get()); } - archetype.set(component); + archetype.set(component); return (component.behavior_tree != nullptr); } static bool load_component_blackbody(entity::archetype& archetype, const json& element) { - entity::component::blackbody component; + game::component::blackbody component; component.temperature = 0.0; if (element.contains("temperature")) component.temperature = element["temperature"].get(); - archetype.set(component); + archetype.set(component); return true; } static bool load_component_celestial_body(entity::archetype& archetype, const json& element) { - entity::component::celestial_body component; + game::component::celestial_body component; if (element.contains("radius")) component.radius = element["radius"].get(); @@ -141,14 +141,14 @@ static bool load_component_celestial_body(entity::archetype& archetype, const js if (element.contains("albedo")) component.albedo = element["albedo"].get(); - archetype.set(component); + archetype.set(component); return true; } static bool load_component_collision(entity::archetype& archetype, resource_manager& resource_manager, const json& element) { - entity::component::collision component; + game::component::collision component; component.mesh = nullptr; if (element.contains("file")) @@ -156,27 +156,27 @@ static bool load_component_collision(entity::archetype& archetype, resource_mana component.mesh = resource_manager.load(element["file"].get()); } - archetype.set(component); + archetype.set(component); return (component.mesh != nullptr); } static bool load_component_diffuse_reflector(entity::archetype& archetype, const json& element) { - entity::component::diffuse_reflector component; + game::component::diffuse_reflector component; component.albedo = 0.0; if (element.contains("albedo")) component.albedo = element["albedo"].get(); - archetype.set(component); + archetype.set(component); return true; } static bool load_component_model(entity::archetype& archetype, resource_manager& resource_manager, const json& element) { - entity::component::model component; + game::component::model component; component.instance_count = 0; //component.layers = ~0; component.layers = 1; @@ -186,14 +186,14 @@ static bool load_component_model(entity::archetype& archetype, resource_manager& component.render_model = resource_manager.load(element["file"].get()); } - archetype.set(component); + archetype.set(component); return true; } static bool load_component_orbit(entity::archetype& archetype, const json& element) { - entity::component::orbit component; + game::component::orbit component; component.parent = entt::null; component.ephemeris_index = -1; @@ -205,14 +205,14 @@ static bool load_component_orbit(entity::archetype& archetype, const json& eleme if (element.contains("scale")) component.scale = element["scale"].get(); - archetype.set(component); + archetype.set(component); return true; } static bool load_component_transform(entity::archetype& archetype, const json& element) { - entity::component::transform component; + game::component::transform component; component.local = math::transform::identity; component.warp = true; @@ -242,7 +242,7 @@ static bool load_component_transform(entity::archetype& archetype, const json& e } component.world = component.local; - archetype.set(component); + archetype.set(component); return true; }