From 1978fc492104455dc515feb56846d8f3b60de32d Mon Sep 17 00:00:00 2001 From: SelfDevTv Date: Mon, 27 May 2024 21:55:13 +0200 Subject: [PATCH] Added example how to register the loaded systems via loadNamespace --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 168db64..b9422d5 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,23 @@ local Systems = {} Concord.utils.loadNamespace("path/to/systems", Systems) print(Systems.systemName) + +-- Registers the loaded systems. Either with a for loop for automatic registering, or manually (you can choose the order) + + +--for loop +for _, system in pairs(Systems) do + world:addSystem(system) +end + +-- or manually +world:addSystems( + Systems.HealthSystem, + Systems.DamageSystem, + Systems.MoveSystem, + -- etc +) + ``` #### Method chaining