From c9a11aec577a0927afb4e97f3041b492621ce666 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 16 Feb 2020 23:25:04 +0100 Subject: added playerid to avoid stringly typing --- src/componentwrapper.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/componentwrapper.rs') diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index 6e11a0b..951745d 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use specs::{Builder, world::LazyBuilder}; +use crate::PlayerId; use crate::components::{Visible, Blocking, Player, Floor, Item, Inventory, Health, Serialise}; use crate::parameter::{Parameter, ParameterType}; @@ -91,7 +92,7 @@ components!( }; Blocking () {Blocking}; Floor () {Floor}; - Player (name: String) {Player::new(name)}; + Player (name: String) {Player::new(PlayerId{name})}; 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}}; -- cgit