aboutsummaryrefslogtreecommitdiff
path: root/src/example/ecs.cpp
diff options
context:
space:
mode:
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;