Changing casing of dualkey map to PascalCase
This commit is contained in:
@@ -43,7 +43,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Entry insert(AKey firstKey, BKey secondKey, Value value) {
|
||||
Entry Insert(AKey firstKey, BKey secondKey, Value value) {
|
||||
DualkeyHash *hash = new DualkeyHash(std::move(firstKey),
|
||||
std::move(secondKey), std::move(value));
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
return {hash->firstKey, hash->secondKey, hash->value};
|
||||
}
|
||||
|
||||
std::size_t remove(std::optional<AKey> firstKey,
|
||||
std::size_t Remove(std::optional<AKey> firstKey,
|
||||
std::optional<BKey> secondKey) {
|
||||
bool isFirstKeyGiven = firstKey.has_value();
|
||||
bool isSecondKeyGiven = secondKey.has_value();
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
}
|
||||
|
||||
[[nodiscard("Discarding an expensive query!")]]
|
||||
std::vector<QueryResult> query(std::optional<AKey> firstKey,
|
||||
std::vector<QueryResult> Query(std::optional<AKey> firstKey,
|
||||
std::optional<BKey> secondKey) {
|
||||
bool isFirstKeyGiven = firstKey.has_value();
|
||||
bool isSecondKeyGiven = secondKey.has_value();
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
return finishedQuery;
|
||||
}
|
||||
|
||||
void scan(std::function<bool(const std::size_t firstKeyHash,
|
||||
void Scan(std::function<bool(const std::size_t firstKeyHash,
|
||||
const std::size_t secondKeyHash, Value &value)>
|
||||
scanFunction) {
|
||||
for (DualkeyHash *hash : hashList) {
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void scan(std::function<bool(const AKey &firstKey, const BKey &secondKey,
|
||||
void Scan(std::function<bool(const AKey &firstKey, const BKey &secondKey,
|
||||
Value &value)>
|
||||
scanFunction) {
|
||||
for (DualkeyHash *hash : hashList) {
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
std::size_t count() {
|
||||
std::size_t Count() {
|
||||
return hashList.size() - graveyard.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
template <isAComponent component, typename... Args>
|
||||
component &AddComponent(const Entity &entity,
|
||||
Args &&...constructionArguments) {
|
||||
auto newComponent = entityComponentMap.insert(
|
||||
auto newComponent = entityComponentMap.Insert(
|
||||
entity, typeid(component), component(constructionArguments...));
|
||||
|
||||
return std::any_cast<component &>(std::get<2>(newComponent));
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
template <isAComponent component>
|
||||
[[nodiscard("Discarding an expensive operation's result!")]]
|
||||
component &GetComponent(const Entity &entity) {
|
||||
auto result = entityComponentMap.query(entity, typeid(component));
|
||||
auto result = entityComponentMap.Query(entity, typeid(component));
|
||||
if (result.empty()) {
|
||||
Logging::Log(std::format("Entity {} does not have component {}!",
|
||||
entity.asString(), typeid(component).name()),
|
||||
@@ -60,14 +60,14 @@ public:
|
||||
template <isAComponent component>
|
||||
[[nodiscard("Discarding an expensive operation's result!")]]
|
||||
bool HasComponent(const Entity &entity) {
|
||||
return entityComponentMap.query(entity, typeid(component)).size();
|
||||
return entityComponentMap.Query(entity, typeid(component)).size();
|
||||
}
|
||||
|
||||
template <isAComponent component>
|
||||
[[nodiscard("It is not guaranteed that a component can always be removed, "
|
||||
"please make sure by checking the returned bool")]]
|
||||
bool RemoveComponent(const Entity &entity) {
|
||||
return entityComponentMap.remove(entity, typeid(component));
|
||||
return entityComponentMap.Remove(entity, typeid(component));
|
||||
}
|
||||
|
||||
// Copying is not allowed since the ECS world is meant to be
|
||||
|
||||
@@ -34,7 +34,7 @@ Entity World::CreateEntity() {
|
||||
auto newEntity = Random::GenerateUUID();
|
||||
|
||||
// Default components
|
||||
entityComponentMap.insert(newEntity, typeid(Components::Base),
|
||||
entityComponentMap.Insert(newEntity, typeid(Components::Base),
|
||||
Components::Base());
|
||||
|
||||
return newEntity;
|
||||
@@ -42,7 +42,7 @@ Entity World::CreateEntity() {
|
||||
|
||||
bool World::EntityExists(const Entity &entity) noexcept {
|
||||
bool exists = false;
|
||||
entityComponentMap.scan(
|
||||
entityComponentMap.Scan(
|
||||
[&exists, entity](const Tourmaline::Type::UUID ¤tEntity,
|
||||
const std::type_index &, std::any &) -> bool {
|
||||
if (currentEntity == entity) {
|
||||
@@ -55,5 +55,5 @@ bool World::EntityExists(const Entity &entity) noexcept {
|
||||
}
|
||||
|
||||
bool World::DestroyEntity(Entity entity) {
|
||||
return entityComponentMap.remove(entity, std::nullopt);
|
||||
return entityComponentMap.Remove(entity, std::nullopt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user