aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ComponentManager.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-06 13:45:05 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-06 13:45:05 +0200
commit509fb6ebdd27bc75375c1c51024ea906e25032c0 (patch)
tree89ef8b7e72b25c30e42d73de08769a4402ef0716 /src/crepe/ComponentManager.h
parent7c9d3452c99fcb89ea6df55755e90f741b23cf10 (diff)
WIP more code style enforcements
Diffstat (limited to 'src/crepe/ComponentManager.h')
-rw-r--r--src/crepe/ComponentManager.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h
index 003cd0b..b88ad27 100644
--- a/src/crepe/ComponentManager.h
+++ b/src/crepe/ComponentManager.h
@@ -22,20 +22,26 @@ public:
public:
//! Add a component of a specific type
- template <typename T, typename... Args> void AddComponent(std::uint32_t id, Args &&... args);
+ template <typename T, typename... Args>
+ void add_component(std::uint32_t id, Args &&... args);
//! Deletes all components of a specific type and id
- template <typename T> void DeleteComponentsById(std::uint32_t id);
+ template <typename T>
+ void delete_components_by_id(std::uint32_t id);
//! Deletes all components of a specific type
- template <typename T> void DeleteComponents();
+ template <typename T>
+ void delete_components();
//! Deletes all components of a specific id
- void DeleteAllComponentsOfId(std::uint32_t id);
+ void delete_all_components_of_id(std::uint32_t id);
//! Deletes all components
- void DeleteAllComponents();
+ void delete_all_components();
//! Get a vector<> of all components at specific type and id
- template <typename T> std::vector<std::reference_wrapper<T>> GetComponentsByID(std::uint32_t id) const;
+ template <typename T>
+ std::vector<std::reference_wrapper<T>>
+ get_components_by_id(std::uint32_t id) const;
//! Get a vector<> of all components of a specific type
- template <typename T> std::vector<std::reference_wrapper<T>> GetComponentsByType() const;
+ template <typename T>
+ std::vector<std::reference_wrapper<T>> get_components_by_type() const;
private:
ComponentManager() = default;
@@ -46,10 +52,11 @@ private:
* The first std::vector<> stores another vector<>. This first vector<> is to bind the entity's id to a component.
* The second std::vector<> stores unique_ptrs. Each component can be gathered via an unique_ptr. This second vector<> allows multiple components of the same std::type_index for one entity (id).
*/
- std::unordered_map<std::type_index, std::vector<std::vector<std::unique_ptr<Component>>>> components;
+ std::unordered_map<std::type_index,
+ std::vector<std::vector<std::unique_ptr<Component>>>>
+ components;
};
-}
+} // namespace crepe
// #include "ComponentManager.hpp"
-