diff options
| author | troido <troido@protonmail.com> | 2020-02-21 17:49:50 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-21 17:49:50 +0100 |
| commit | 07cc6d8919193c38cc13b2567ede5a510938db18 (patch) | |
| tree | 83588f118036fa56905043eb23c5a1d79e0497da /src/componentwrapper.rs | |
| parent | e69d9c3b5266fd6f9215d1e3f4a761b8027a785c (diff) | |
players can now go to different rooms
Diffstat (limited to 'src/componentwrapper.rs')
| -rw-r--r-- | src/componentwrapper.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index e5f9b9f..9e98332 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -2,14 +2,14 @@ use std::collections::HashMap; use specs::Builder; -use crate::PlayerId; -use crate::components::{Visible, Blocking, Player, Floor, Item, Inventory, Health, Serialise}; +use crate::{PlayerId, RoomId}; +use crate::components::{Visible, Blocking, Player, Floor, Item, Inventory, Health, Serialise, RoomExit}; use crate::parameter::{Parameter, ParameterType}; macro_rules! components { - ($($comp: ident ($($paramname: ident : $paramtype: ident),*) {$creation: expr});*) => { + ($($comp: ident ($($paramname: ident : $paramtype: ident),*) {$creation: expr});*;) => { #[derive(Clone)] pub enum ComponentWrapper{ @@ -96,7 +96,8 @@ components!( Item (ent: Template, name: String) {Item{ent, name}}; Inventory (capacity: Int) {Inventory{items: Vec::new(), capacity: capacity as usize}}; Health (health: Int, maxhealth: Int) {Health{health, maxhealth}}; - Serialise (template: Template) {Serialise{template}} + Serialise (template: Template) {Serialise{template}}; + RoomExit (destination: String) {RoomExit{destination: RoomId::from_str(&destination)}}; ); |
