osb/source/game/StarTechDatabase.hpp

53 lines
837 B
C++
Raw Normal View History

2023-06-20 04:33:09 +00:00
#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