summaryrefslogtreecommitdiff
path: root/src/components.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-01-28 22:58:16 +0100
committertroido <troido@protonmail.com>2020-01-28 22:58:16 +0100
commitb3356eabcea09f599ad99c1332450e4d9570161b (patch)
tree3cdb9c9a2092f66a3f3d9dfeade6fcb80294579c /src/components.rs
parent1175f8b436d15c47fb60866755921fc68183dc72 (diff)
refacored systems, components, resources and assemblages into their own files
Diffstat (limited to 'src/components.rs')
-rw-r--r--src/components.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components.rs b/src/components.rs
new file mode 100644
index 0000000..51469cc
--- /dev/null
+++ b/src/components.rs
@@ -0,0 +1,26 @@
+
+use specs::{
+ VecStorage,
+ Component
+};
+
+use super::controls::Control;
+
+
+#[derive(Component, Debug, Hash, PartialEq, Eq, Clone, Copy)]
+#[storage(VecStorage)]
+pub struct Position {
+ pub x: i32,
+ pub y: i32
+}
+
+#[derive(Component, Debug, Clone)]
+#[storage(VecStorage)]
+pub struct Visible {
+ pub sprite: String,
+ pub height: f32
+}
+
+#[derive(Component, Debug)]
+#[storage(VecStorage)]
+pub struct Controller(pub Option<Control>);