summaryrefslogtreecommitdiffhomepage
path: root/app/ECS/systems
diff options
context:
space:
mode:
Diffstat (limited to 'app/ECS/systems')
-rw-r--r--app/ECS/systems/00_movement.rb22
-rw-r--r--app/ECS/systems/01_flying.rb17
2 files changed, 39 insertions, 0 deletions
diff --git a/app/ECS/systems/00_movement.rb b/app/ECS/systems/00_movement.rb
new file mode 100644
index 0000000..ced0343
--- /dev/null
+++ b/app/ECS/systems/00_movement.rb
@@ -0,0 +1,22 @@
+class ECS
+ class Systems
+ class Movement
+ def self.run
+ ECS::Components::TestComponent.data.each do |key, data|
+ puts "Entity ID: #{key}"
+ unless (ECS::Components::Based.id - ECS::Entity.signatures[key]).zero?
+ unless (ECS::Components::Based.id & ECS::Entity.signatures[key]).zero?
+ puts "Based Data: "
+ puts "eks: #{ECS::Components::Based.data[key].x += 2}"
+ puts "why: #{ECS::Components::Based.data[key].y += 2}"
+ end
+ end
+ puts "Movement:"
+ puts "x: #{data.x += 1}"
+ puts "y: #{data.y += 1}"
+ puts "---"
+ end
+ end
+ end
+ end
+end
diff --git a/app/ECS/systems/01_flying.rb b/app/ECS/systems/01_flying.rb
new file mode 100644
index 0000000..493e999
--- /dev/null
+++ b/app/ECS/systems/01_flying.rb
@@ -0,0 +1,17 @@
+class ECS
+ class Systems
+ class Based
+ def self.run
+ ECS::Components::Based.data.each do |key, data|
+ if ECS::Components::Based.id == ECS::Entity.signatures[key]
+ puts "Entity ID: #{key}"
+ puts "ONLY Based Data: "
+ puts "eks: #{ECS::Components::Based.data[key].x += 3}"
+ puts "why: #{ECS::Components::Based.data[key].y += 3}"
+ puts "---"
+ end
+ end
+ end
+ end
+ end
+end