Implements ConstString in several core places in the library, improving performance.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef CREATURELIB_ATTACKDATA_HPP
|
||||
#define CREATURELIB_ATTACKDATA_HPP
|
||||
|
||||
#include <Arbutils/ConstString.hpp>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "AttackCategory.hpp"
|
||||
@@ -17,11 +18,12 @@ namespace CreatureLib::Library {
|
||||
uint8_t _baseUsages;
|
||||
AttackTarget _target;
|
||||
int8_t _priority;
|
||||
std::unordered_set<std::string> _flags;
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> _flags;
|
||||
|
||||
public:
|
||||
AttackData(std::string name, uint8_t type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, AttackTarget target, int8_t priority, std::unordered_set<std::string> flags);
|
||||
uint8_t baseUsage, AttackTarget target, int8_t priority,
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags);
|
||||
virtual ~AttackData() = default;
|
||||
|
||||
inline const std::string& GetName() const { return _name; }
|
||||
@@ -33,7 +35,7 @@ namespace CreatureLib::Library {
|
||||
inline AttackTarget GetTarget() const { return _target; }
|
||||
inline int8_t GetPriority() const { return _priority; }
|
||||
|
||||
bool HasFlag(const std::string& key) const;
|
||||
bool HasFlag(const Arbutils::CaseInsensitiveConstString& key) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user