summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-11-16 23:25:08 +0100
committerAki <please@ignore.pl>2022-11-16 23:25:08 +0100
commit282c56b6a1e1d9a47363e362ade013317a957b99 (patch)
treebc9aed072f5a0917f8b9d444eac15843cb5d53d4
parent67442e86f53a27ddf9014cbe843ba63b08ef52bc (diff)
downloadkurator-282c56b6a1e1d9a47363e362ade013317a957b99.zip
kurator-282c56b6a1e1d9a47363e362ade013317a957b99.tar.gz
kurator-282c56b6a1e1d9a47363e362ade013317a957b99.tar.bz2
Added interface for Spawner
-rw-r--r--battles/src/RandomSpawner.h6
-rw-r--r--battles/src/Spawner.h21
2 files changed, 25 insertions, 2 deletions
diff --git a/battles/src/RandomSpawner.h b/battles/src/RandomSpawner.h
index 7505ae8..1ef2f20 100644
--- a/battles/src/RandomSpawner.h
+++ b/battles/src/RandomSpawner.h
@@ -4,6 +4,8 @@
#include <kurator/battles/components.h>
+#include "Spawner.h"
+
namespace kurator
{
@@ -11,11 +13,11 @@ namespace battles
{
-class RandomSpawner
+class RandomSpawner : public Spawner
{
public:
RandomSpawner(int total_teams, double distance, double variation);
- Transform get(int team);
+ Transform get(int team) override;
private:
const double angle_step;
std::random_device device;
diff --git a/battles/src/Spawner.h b/battles/src/Spawner.h
new file mode 100644
index 0000000..ebae699
--- /dev/null
+++ b/battles/src/Spawner.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <kurator/battles/components.h>
+
+
+namespace kurator
+{
+namespace battles
+{
+
+
+class Spawner
+{
+public:
+ virtual ~Spawner() = default;
+ virtual Transform get(int team) = 0;
+};
+
+
+} // namespace battles
+} // namespace kurator