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/components.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/components.rs') diff --git a/src/components.rs b/src/components.rs index 1f5630d..126f20e 100644 --- a/src/components.rs +++ b/src/components.rs @@ -7,8 +7,8 @@ use specs::{ Component }; -use super::controls::Control; -use super::pos::Pos; +use crate::{Pos, PlayerId}; +use crate::controls::Control; use crate::template::Template; @@ -58,11 +58,11 @@ pub struct Moved { #[derive(Component, Debug, Clone)] #[storage(HashMapStorage)] pub struct Player { - pub name: String + pub id: PlayerId } impl Player { - pub fn new(name: String) -> Self { - Self{name} + pub fn new(id: PlayerId) -> Self { + Self{id} } } -- cgit