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

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayerTech.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/StarPlayerTech.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarPlayerTech.hpp')
-rw-r--r--source/game/StarPlayerTech.hpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/game/StarPlayerTech.hpp b/source/game/StarPlayerTech.hpp
new file mode 100644
index 0000000..20f3183
--- /dev/null
+++ b/source/game/StarPlayerTech.hpp
@@ -0,0 +1,46 @@
+#ifndef STAR_PLAYER_TECH_HPP
+#define STAR_PLAYER_TECH_HPP
+
+#include "StarTechDatabase.hpp"
+
+namespace Star {
+
+STAR_EXCEPTION(PlayerTechException, StarException);
+
+STAR_CLASS(PlayerTech);
+
+// Set of player techs, techs can be either unavailable, available but not
+// enabled, enabled but not equipped, or equipped.
+class PlayerTech {
+public:
+ PlayerTech();
+ PlayerTech(Json const& json);
+
+ Json toJson() const;
+
+ bool isAvailable(String const& techModule) const;
+ void makeAvailable(String const& techModule);
+ void makeUnavailable(String const& techModule);
+
+ bool isEnabled(String const& techModule) const;
+ void enable(String const& techModule);
+ void disable(String const& techModule);
+
+ bool isEquipped(String const& techModule) const;
+ void equip(String const& techModule);
+ void unequip(String const& techModule);
+
+ StringSet const& availableTechs() const;
+ StringSet const& enabledTechs() const;
+ HashMap<TechType, String> const& equippedTechs() const;
+ StringList techModules() const;
+
+private:
+ StringSet m_availableTechs;
+ StringSet m_enabledTechs;
+ HashMap<TechType, String> m_equippedTechs;
+};
+
+}
+
+#endif