aboutsummaryrefslogtreecommitdiff
path: root/mwe/ecs-homemade/src/main.cpp
diff options
context:
space:
mode:
authorMax-001 <80035972+Max-001@users.noreply.github.com>2024-10-05 12:36:26 +0200
committerMax-001 <80035972+Max-001@users.noreply.github.com>2024-10-05 12:36:26 +0200
commit765550bce8a81c6f0c79c0083b14ef68e0c900b2 (patch)
tree125a816a17d78bb8d68915b801d93e0083b660ba /mwe/ecs-homemade/src/main.cpp
parenta5fa49f39473a8d2dc535145cb34866967ec10ab (diff)
Removed the std::pair to improve test
Diffstat (limited to 'mwe/ecs-homemade/src/main.cpp')
-rw-r--r--mwe/ecs-homemade/src/main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/mwe/ecs-homemade/src/main.cpp b/mwe/ecs-homemade/src/main.cpp
index c78e085..41f7d6d 100644
--- a/mwe/ecs-homemade/src/main.cpp
+++ b/mwe/ecs-homemade/src/main.cpp
@@ -24,20 +24,20 @@ int main() {
//This is what systems would do:
- std::vector<std::pair<std::reference_wrapper<Sprite>, std::uint32_t>> sprites = ComponentManager::GetInstance().GetComponentsByType<Sprite>();
- for(auto& [sprite, id] : sprites) {
+ std::vector<std::reference_wrapper<Sprite>> sprites = ComponentManager::GetInstance().GetComponentsByType<Sprite>();
+ for(Sprite& sprite : sprites) {
//std::cout << sprite.get().mPath << std::endl;
}
//std::cout << std::endl;
- std::vector<std::pair<std::reference_wrapper<Rigidbody>, std::uint32_t>> rigidBodies = ComponentManager::GetInstance().GetComponentsByType<Rigidbody>();
- for(auto& [rigidbody, id] : rigidBodies) {
+ std::vector<std::reference_wrapper<Rigidbody>> rigidBodies = ComponentManager::GetInstance().GetComponentsByType<Rigidbody>();
+ for(Rigidbody& rigidbody : rigidBodies) {
//std::cout << rigidbody.get().mMass << " " << rigidbody.get().mGravityScale << " " << rigidbody.get().mBodyType << std::endl;
}
//std::cout << std::endl;
-
- std::vector<std::pair<std::reference_wrapper<Colider>, std::uint32_t>> coliders = ComponentManager::GetInstance().GetComponentsByType<Colider>();
- for(auto& [colider, id] : coliders) {
+
+ std::vector<std::reference_wrapper<Colider>> coliders = ComponentManager::GetInstance().GetComponentsByType<Colider>();
+ for(Colider& colider : coliders) {
//std::cout << colider.get().mSize << std::endl;
}