diff options
author | Aki <please@ignore.pl> | 2023-04-23 12:54:14 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-04-05 19:41:19 +0200 |
commit | 975339d07aeb193564221adff31b55a913d92a1e (patch) | |
tree | 957b37e922e494780874bbc8e495a1a5e412fb76 /sim/include | |
parent | bdfb27ba04528f213dcadc00afdcf1f35a61f6fc (diff) | |
download | kurator-975339d07aeb193564221adff31b55a913d92a1e.zip kurator-975339d07aeb193564221adff31b55a913d92a1e.tar.gz kurator-975339d07aeb193564221adff31b55a913d92a1e.tar.bz2 |
Separated Turret from AI, shuffled their units
Diffstat (limited to 'sim/include')
-rw-r--r-- | sim/include/kurator/sim/TurretControl.h | 25 | ||||
-rw-r--r-- | sim/include/kurator/sim/ai.h | 23 | ||||
-rw-r--r-- | sim/include/kurator/sim/components.h | 8 | ||||
-rw-r--r-- | sim/include/kurator/sim/weapons.h | 31 |
4 files changed, 54 insertions, 33 deletions
diff --git a/sim/include/kurator/sim/TurretControl.h b/sim/include/kurator/sim/TurretControl.h deleted file mode 100644 index ecafb90..0000000 --- a/sim/include/kurator/sim/TurretControl.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include <entt/entt.hpp> - -#include "State.h" - - -namespace kurator -{ -namespace sim -{ - - -struct TurretControl -{ - double delay; - double reload; - int rounds; - entt::entity owner; - static void update(State& ctx); -}; - - -} // namespace sim -} // namespace kurator diff --git a/sim/include/kurator/sim/ai.h b/sim/include/kurator/sim/ai.h new file mode 100644 index 0000000..f9899d6 --- /dev/null +++ b/sim/include/kurator/sim/ai.h @@ -0,0 +1,23 @@ +#pragma once + +#include <entt/entt.hpp> + +#include <kurator/engine/Point.h> + + +namespace kurator +{ +namespace sim +{ + + +struct AIShip +{ + double keep_at_range; + engine::Point destination; + entt::entity target = entt::null; +}; + + +} // namespace sim +} // namespace kurator diff --git a/sim/include/kurator/sim/components.h b/sim/include/kurator/sim/components.h index f329c0e..c4d8abc 100644 --- a/sim/include/kurator/sim/components.h +++ b/sim/include/kurator/sim/components.h @@ -25,13 +25,5 @@ struct Team }; -struct AIState -{ - double keep_at_range; - engine::Point destination; - entt::entity target = entt::null; -}; - - } // namespace sim } // namespace kurator diff --git a/sim/include/kurator/sim/weapons.h b/sim/include/kurator/sim/weapons.h new file mode 100644 index 0000000..7dd5b3b --- /dev/null +++ b/sim/include/kurator/sim/weapons.h @@ -0,0 +1,31 @@ +#pragma once + +#include <entt/entt.hpp> + +#include <kurator/universe/TurretType.h> + +#include "State.h" + + +namespace kurator +{ +namespace sim +{ + + +struct Turret +{ + entt::entity owner; + universe::TurretType type; + double delay = 0.0; + double reload = 0.0; + int rounds = type.rounds; + void shoot_at(State& ctx, const entt::entity& target, double distance); +}; + + +void update_turrets(State& ctx); + + +} // namespace sim +} // namespace kurator |