diff options
| author | troido <troido@protonmail.com> | 2020-02-22 22:00:32 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-22 22:00:32 +0100 |
| commit | f4331041e5d906f95063f317852f32f19e6cdf9c (patch) | |
| tree | e855402de7b2dcec81c91d97ab6a7e359689ecc5 /src/components.rs | |
| parent | 2b0cc677f4092d94b31e95f3e9961ec6ed91327b (diff) | |
items now have an action enum
Diffstat (limited to 'src/components.rs')
| -rw-r--r-- | src/components.rs | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/src/components.rs b/src/components.rs deleted file mode 100644 index 9d387f1..0000000 --- a/src/components.rs +++ /dev/null @@ -1,100 +0,0 @@ - -use specs::{ - DenseVecStorage, - VecStorage, - HashMapStorage, - FlaggedStorage, - Component -}; - -use crate::{Pos, PlayerId, RoomId, Sprite}; -use crate::controls::Control; -use crate::template::Template; - - -#[derive(Debug, Clone)] -pub struct Position{ - pub pos: Pos -} -impl Position { - pub fn new(pos: Pos) -> Position { - Position{pos} - } -} - -impl Component for Position { - type Storage = FlaggedStorage<Self, VecStorage<Self>>; -} - -#[derive(Debug, Clone)] -pub struct Visible { - pub sprite: Sprite, - pub height: f64, - pub name: String -} -impl Component for Visible { - type Storage = FlaggedStorage<Self, VecStorage<Self>>; -} - -#[derive(Component, Debug)] -pub struct Controller(pub Control); - -#[derive(Component, Debug, Clone)] -pub struct Blocking; - -#[derive(Component, Debug, Clone)] -pub struct Floor; - -#[derive(Component, Debug, Clone)] -pub struct New; - -#[derive(Component, Debug, Clone)] -pub struct Removed; - -#[derive(Component, Debug, Clone)] -pub struct Moved { - pub from: Pos -} - -#[derive(Component, Debug, Clone)] -#[storage(HashMapStorage)] -pub struct Player { - pub id: PlayerId -} -impl Player { - pub fn new(id: PlayerId) -> Self { - Self{id} - } -} - -#[derive(Debug, Clone, Default)] -pub struct Inventory { - pub items: Vec<Item>, - pub capacity: usize -} -impl Component for Inventory { - type Storage = FlaggedStorage<Self, HashMapStorage<Self>>; -} - - -#[derive(Component, Debug, Clone)] -pub struct Item { - pub ent: Template, - pub name: String -} - -#[derive(Component, Debug, Clone)] -pub struct Health { - pub health: i64, - pub maxhealth: i64 -} - -#[derive(Component, Debug, Clone)] -pub struct Serialise { - pub template: Template -} - -#[derive(Component, Debug, Clone)] -pub struct RoomExit { - pub destination: RoomId -} |
