Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarTechDatabase.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarTechDatabase.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarTechDatabase.hpp')
-rw-r--r--source/game/StarTechDatabase.hpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/source/game/StarTechDatabase.hpp b/source/game/StarTechDatabase.hpp
new file mode 100644
index 0000000..cb541cc
--- /dev/null
+++ b/source/game/StarTechDatabase.hpp
@@ -0,0 +1,52 @@
+#ifndef STAR_TECH_DATABASE_HPP
+#define STAR_TECH_DATABASE_HPP
+
+#include "StarJson.hpp"
+#include "StarBiMap.hpp"
+#include "StarGameTypes.hpp"
+
+namespace Star {
+
+STAR_EXCEPTION(TechDatabaseException, StarException);
+
+STAR_CLASS(TechDatabase);
+
+enum class TechType {
+ Head,
+ Body,
+ Legs
+};
+extern EnumMap<TechType> const TechTypeNames;
+
+struct TechConfig {
+ String name;
+ String path;
+ Json parameters;
+
+ TechType type;
+
+ StringList scripts;
+ Maybe<String> animationConfig;
+
+ String description;
+ String shortDescription;
+ Rarity rarity;
+ String icon;
+};
+
+class TechDatabase {
+public:
+ TechDatabase();
+
+ bool contains(String const& techName) const;
+ TechConfig tech(String const& techName) const;
+
+private:
+ TechConfig parseTech(Json const& config, String const& path) const;
+
+ StringMap<TechConfig> m_tech;
+};
+
+}
+
+#endif