From 57ccd454201966e64bddcf4080c2a10988523801 Mon Sep 17 00:00:00 2001 From: rasul Date: Sun, 5 Apr 2020 15:06:22 -0500 Subject: [PATCH] add a from_ref() method to get a Zone from a &Zone --- src/world/zone.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/world/zone.rs b/src/world/zone.rs index 8c57e26..f5d0119 100644 --- a/src/world/zone.rs +++ b/src/world/zone.rs @@ -17,6 +17,18 @@ pub struct Zone { pub areas: HashSet, } +impl Zone { + pub fn from_ref(zone: &Self) -> Self { + Self { + id: zone.id, + parent: zone.parent, + name: zone.name.clone(), + users_visible: zone.users_visible, + areas: zone.areas.clone(), + } + } +} + impl Area for Zone { fn id(&self) -> Id { self.id