summaryrefslogtreecommitdiff
path: root/universe/include
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-11-15 00:37:54 +0100
committerAki <please@ignore.pl>2022-11-15 00:37:54 +0100
commit5d0cba2b45aa30226ba72231b35424d404a5eec1 (patch)
tree4b157bbb550534eec38b1a0b45e2cbd10ce43fcb /universe/include
parent4f3de714cd04ee5d99167f415843573d6bbd9f62 (diff)
downloadkurator-5d0cba2b45aa30226ba72231b35424d404a5eec1.zip
kurator-5d0cba2b45aa30226ba72231b35424d404a5eec1.tar.gz
kurator-5d0cba2b45aa30226ba72231b35424d404a5eec1.tar.bz2
Implemented naive skeleton for types repository in universe
Diffstat (limited to 'universe/include')
-rw-r--r--universe/include/kurator/universe.h18
-rw-r--r--universe/include/kurator/universe/NotFound.h24
-rw-r--r--universe/include/kurator/universe/Repository.h25
3 files changed, 67 insertions, 0 deletions
diff --git a/universe/include/kurator/universe.h b/universe/include/kurator/universe.h
new file mode 100644
index 0000000..73d06ae
--- /dev/null
+++ b/universe/include/kurator/universe.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <memory>
+
+#include "universe/Repository.h"
+
+
+namespace kurator
+{
+namespace universe
+{
+
+
+auto load_sample() -> std::shared_ptr<Repository>;
+
+
+} // namespace universe
+} // namespace kurator
diff --git a/universe/include/kurator/universe/NotFound.h b/universe/include/kurator/universe/NotFound.h
new file mode 100644
index 0000000..03d344d
--- /dev/null
+++ b/universe/include/kurator/universe/NotFound.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <exception>
+#include <string>
+
+
+namespace kurator
+{
+namespace universe
+{
+
+
+class NotFound : public std::exception
+{
+public:
+ explicit NotFound(std::string _id);
+ const char* what() const noexcept override;
+private:
+ const std::string id;
+};
+
+
+} // namespace universe
+} // namespace kurator
diff --git a/universe/include/kurator/universe/Repository.h b/universe/include/kurator/universe/Repository.h
new file mode 100644
index 0000000..8d44793
--- /dev/null
+++ b/universe/include/kurator/universe/Repository.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <string>
+
+#include "ShipType.h"
+#include "TurretType.h"
+
+
+namespace kurator
+{
+namespace universe
+{
+
+
+class Repository
+{
+public:
+ virtual ~Repository() = default;
+ virtual ShipType ship_type(const std::string& id) const = 0;
+ virtual TurretType turret_type(const std::string& id) const = 0;
+};
+
+
+} // namespace universe
+} // namespace kurator