Implement basic type library.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-04 17:58:26 +01:00
parent b4e08049ce
commit 168e14d394
5 changed files with 75 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
#ifndef CREATURELIB_TYPELIBRARY_HPP
#define CREATURELIB_TYPELIBRARY_HPP
#include <unordered_map>
#include <vector>
namespace CreatureLib::Library{
class TypeLibrary {
std::unordered_map<std::string, uint8_t > _types;
std::vector<std::vector<float>> _effectiveness;
public:
uint8_t GetTypeId(const std::string& s) const;
float GetSingleEffectiveness(uint8_t attacking, uint8_t defensive) const;
float GetEffectiveness(uint8_t attacking, const std::vector<uint8_t>& defensive) const;
uint8_t RegisterType(const std::string& typeName);
void SetEffectiveness(uint8_t attacking, uint8_t defensive, float effectiveness);
};
}
#endif //CREATURELIB_TYPELIBRARY_HPP