summaryrefslogtreecommitdiffhomepage
path: root/app/ECS/components
diff options
context:
space:
mode:
Diffstat (limited to 'app/ECS/components')
-rw-r--r--app/ECS/components/00_test_component.rb16
-rw-r--r--app/ECS/components/01_based.rb16
2 files changed, 32 insertions, 0 deletions
diff --git a/app/ECS/components/00_test_component.rb b/app/ECS/components/00_test_component.rb
new file mode 100644
index 0000000..0906fc8
--- /dev/null
+++ b/app/ECS/components/00_test_component.rb
@@ -0,0 +1,16 @@
+class ECS
+ class Components
+ class TestComponent < ECS::BaseComponent
+ def self.id
+ @id = '0001'.to_i(2)
+ end
+
+ attr_accessor :x, :y
+
+ def initialize(x: 0, y: 0)
+ @x = x
+ @y = y
+ end
+ end
+ end
+end
diff --git a/app/ECS/components/01_based.rb b/app/ECS/components/01_based.rb
new file mode 100644
index 0000000..fe564ca
--- /dev/null
+++ b/app/ECS/components/01_based.rb
@@ -0,0 +1,16 @@
+class ECS
+ class Components
+ class Based < ECS::BaseComponent
+ def self.id
+ @id = '0010'.to_i(2)
+ end
+
+ attr_accessor :x, :y
+
+ def initialize(x: 0, y:0)
+ @x = x
+ @y = y
+ end
+ end
+ end
+end