diff options
| author | troido <troido@protonmail.com> | 2020-01-28 22:58:16 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-01-28 22:58:16 +0100 |
| commit | b3356eabcea09f599ad99c1332450e4d9570161b (patch) | |
| tree | 3cdb9c9a2092f66a3f3d9dfeade6fcb80294579c /src/components.rs | |
| parent | 1175f8b436d15c47fb60866755921fc68183dc72 (diff) | |
refacored systems, components, resources and assemblages into their own files
Diffstat (limited to 'src/components.rs')
| -rw-r--r-- | src/components.rs | 26 |
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>); |
