From caa48ce5946d093daaf950751dfa1432ea5373a9 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 8 Nov 2022 23:54:23 +0100 Subject: Creating skeleton for battle simulation and universe data This might be a bit too much and a bit too blindly, but let's see how it evolves. --- CMakeLists.txt | 3 +++ battles/CMakeLists.txt | 14 ++++++++++++++ battles/include/kurator/battles/Battle.h | 22 ++++++++++++++++++++++ battles/include/kurator/battles/Scenario.h | 22 ++++++++++++++++++++++ battles/include/kurator/battles/ShipConfig.h | 23 +++++++++++++++++++++++ battles/src/Battle.cpp | 18 ++++++++++++++++++ universe/CMakeLists.txt | 8 ++++++++ universe/include/kurator/universe/ShipType.h | 20 ++++++++++++++++++++ universe/include/kurator/universe/TurretType.h | 22 ++++++++++++++++++++++ 9 files changed, 152 insertions(+) create mode 100644 battles/CMakeLists.txt create mode 100644 battles/include/kurator/battles/Battle.h create mode 100644 battles/include/kurator/battles/Scenario.h create mode 100644 battles/include/kurator/battles/ShipConfig.h create mode 100644 battles/src/Battle.cpp create mode 100644 universe/CMakeLists.txt create mode 100644 universe/include/kurator/universe/ShipType.h create mode 100644 universe/include/kurator/universe/TurretType.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 07becab..6a2541b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,5 +3,8 @@ project(kurator) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS No) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") +find_package(EnTT 3 REQUIRED) find_package(raylib 4 REQUIRED) +add_subdirectory(battles) add_subdirectory(kurator) +add_subdirectory(universe) diff --git a/battles/CMakeLists.txt b/battles/CMakeLists.txt new file mode 100644 index 0000000..c9b2c19 --- /dev/null +++ b/battles/CMakeLists.txt @@ -0,0 +1,14 @@ +project(battles) +add_library( + ${PROJECT_NAME} + src/Battle.cpp +) +target_include_directories( + ${PROJECT_NAME} + PUBLIC include +) +target_link_libraries( + ${PROJECT_NAME} + PUBLIC EnTT::EnTT + PUBLIC universe +) diff --git a/battles/include/kurator/battles/Battle.h b/battles/include/kurator/battles/Battle.h new file mode 100644 index 0000000..0923f36 --- /dev/null +++ b/battles/include/kurator/battles/Battle.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "Scenario.h" + + +namespace kurator +{ +namespace battles +{ + + +struct Battle +{ + explicit Battle(Scenario scenario); + entt::registry registry; +}; + + +} // namespace battles +} // namespace kurator diff --git a/battles/include/kurator/battles/Scenario.h b/battles/include/kurator/battles/Scenario.h new file mode 100644 index 0000000..94adf73 --- /dev/null +++ b/battles/include/kurator/battles/Scenario.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "ShipConfig.h" + + +namespace kurator +{ +namespace battles +{ + + +struct Scenario +{ + using TeamComposition = std::vector; + std::vector teams; +}; + + +} // namespace battles +} // namespace kurator diff --git a/battles/include/kurator/battles/ShipConfig.h b/battles/include/kurator/battles/ShipConfig.h new file mode 100644 index 0000000..f2315fe --- /dev/null +++ b/battles/include/kurator/battles/ShipConfig.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include +#include + + +namespace kurator +{ +namespace battles +{ + + +struct ShipConfig +{ + universe::ShipType type; + std::vector turrets; +}; + + +} // namespace battles +} // namespace kurator diff --git a/battles/src/Battle.cpp b/battles/src/Battle.cpp new file mode 100644 index 0000000..e185a68 --- /dev/null +++ b/battles/src/Battle.cpp @@ -0,0 +1,18 @@ +#include + +#include + + +namespace kurator +{ +namespace battles +{ + + +Battle::Battle(Scenario) +{ +} + + +} // namespace battles +} // namespace kurator diff --git a/universe/CMakeLists.txt b/universe/CMakeLists.txt new file mode 100644 index 0000000..24457c5 --- /dev/null +++ b/universe/CMakeLists.txt @@ -0,0 +1,8 @@ +project(universe) +add_library( + ${PROJECT_NAME} INTERFACE +) +target_include_directories( + ${PROJECT_NAME} + INTERFACE include +) diff --git a/universe/include/kurator/universe/ShipType.h b/universe/include/kurator/universe/ShipType.h new file mode 100644 index 0000000..5f5eec1 --- /dev/null +++ b/universe/include/kurator/universe/ShipType.h @@ -0,0 +1,20 @@ +#pragma once + +#include + + +namespace kurator +{ +namespace universe +{ + + +struct ShipType +{ + std::string name; + double base_health_points; +}; + + +} // namespace universe +} // namespace kurator diff --git a/universe/include/kurator/universe/TurretType.h b/universe/include/kurator/universe/TurretType.h new file mode 100644 index 0000000..b3a6eb2 --- /dev/null +++ b/universe/include/kurator/universe/TurretType.h @@ -0,0 +1,22 @@ +#pragma once + +#include + + +namespace kurator +{ +namespace universe +{ + + +struct TurretType +{ + std::string name; + double base_damage; + double rate_of_fire; + double range; +}; + + +} // namespace universe +} // namespace kurator -- cgit v1.1