aboutsummaryrefslogtreecommitdiff
path: root/src/example/ecs.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-15 20:39:07 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-15 20:39:07 +0100
commite8cd950b8ebd152d76d588d4fedc7f4c239b0835 (patch)
tree7919d13a79d52f1365bc19bf1b435a6264ee5512 /src/example/ecs.cpp
parent5bee4515c1089ce3499bc3b74780db94f0c02306 (diff)
parent9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (diff)
merge `master` into `loek/cleanup`
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 5f83da1..711bde6 100644
--- a/src/example/ecs.cpp
+++ b/src/example/ecs.cpp
@@ -36,24 +36,21 @@ int main() {
}
// Get the Metadata and Transform components of each GameObject
- 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;