diff options
Diffstat (limited to 'app/ECS/base_component.rb')
| -rw-r--r-- | app/ECS/base_component.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/ECS/base_component.rb b/app/ECS/base_component.rb new file mode 100644 index 0000000..a40ef52 --- /dev/null +++ b/app/ECS/base_component.rb @@ -0,0 +1,17 @@ +class ECS + class BaseComponent + class <<self + def data + @data ||= {} + end + + def add(entity_id, **args) + data[entity_id] = new(**args) + end + + def delete(entity_id) + data.delete entity_id + end + end + end +end |
