From 07cc6d8919193c38cc13b2567ede5a510938db18 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 21 Feb 2020 17:49:50 +0100 Subject: players can now go to different rooms --- src/roomtemplate.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/roomtemplate.rs') diff --git a/src/roomtemplate.rs b/src/roomtemplate.rs index cb8ae6a..49dd7af 100644 --- a/src/roomtemplate.rs +++ b/src/roomtemplate.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use serde_json::Value; use crate::Pos; use crate::template::Template; +use crate::{Result, aerr}; pub struct RoomTemplate { pub size: (i64, i64), @@ -12,7 +13,7 @@ pub struct RoomTemplate { impl RoomTemplate { - pub fn from_json(jsonroom: &Value) -> Result{ + pub fn from_json(jsonroom: &Value) -> Result{ let size = ( jsonroom.get("width").ok_or("no with")?.as_i64().ok_or("with not a number")?, jsonroom.get("height").ok_or("no height")?.as_i64().ok_or("height not a number")? @@ -24,10 +25,10 @@ impl RoomTemplate { let mut templates: Vec