aboutsummaryrefslogtreecommitdiff
path: root/src/example/ecs.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-15 20:03:51 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-15 20:03:51 +0100
commit9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (patch)
tree3dd74938da60a0de1a77360280c15ff8949d02cf /src/example/ecs.cpp
parent424611c6016e4a189e3a887fabe8e45b637e80f4 (diff)
parentb597af6c64ccf50c7f92a2b78e7950ee3ab230f7 (diff)
Merge branch 'loek/wrap'
Diffstat (limited to 'src/example/ecs.cpp')
-rw-r--r--src/example/ecs.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/example/ecs.cpp b/src/example/ecs.cpp
index e61c398..3197100 100644
--- a/src/example/ecs.cpp
+++ b/src/example/ecs.cpp
@@ -31,24 +31,21 @@ int main() {
// Get the Metadata and Transform components of each GameObject
ComponentManager & mgr = ComponentManager::get_instance();
- vector<reference_wrapper<Metadata>> metadata
- = mgr.get_components_by_type<Metadata>();
- vector<reference_wrapper<Transform>> transform
- = mgr.get_components_by_type<Transform>();
+ vector<reference_wrapper<Metadata>> metadata = mgr.get_components_by_type<Metadata>();
+ vector<reference_wrapper<Transform>> transform = mgr.get_components_by_type<Transform>();
// Print the Metadata and Transform components
for (auto & m : metadata) {
cout << "Id: " << m.get().game_object_id << " Name: " << m.get().name
- << " Tag: " << m.get().tag << " Parent: " << m.get().parent
- << " Children: ";
+ << " Tag: " << m.get().tag << " Parent: " << m.get().parent << " Children: ";
for (auto & c : m.get().children) {
cout << c << " ";
}
cout << endl;
}
for (auto & t : transform) {
- cout << "Id: " << t.get().game_object_id << " Position: ["
- << t.get().position.x << ", " << t.get().position.y << "]" << endl;
+ cout << "Id: " << t.get().game_object_id << " Position: [" << t.get().position.x
+ << ", " << t.get().position.y << "]" << endl;
}
return 0;