summaryrefslogtreecommitdiffhomepage
path: root/app/ECS/components
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-05-14 05:48:50 -0400
committerrealtradam <[email protected]>2021-05-14 05:48:50 -0400
commit6a2996ceae968029be26ed7ebae8785dcfe877d2 (patch)
treef3d4d405f7e032fcabbb9711f75e266282d98295 /app/ECS/components
parent57bd7ec9da14b3e7e338184568a273ce602e1557 (diff)
downloadtypemon-code-6a2996ceae968029be26ed7ebae8785dcfe877d2.tar.gz
typemon-code-6a2996ceae968029be26ed7ebae8785dcfe877d2.zip
added ECS system
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