From 76df4eb85cadf9cf548b4aa1cc95970e1d53f48d Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 1 May 2016 14:52:43 +0200 Subject: Implement loading saved games on server --- inc/Item.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc/Item.inc') diff --git a/inc/Item.inc b/inc/Item.inc index bef6d00..8e90998 100644 --- a/inc/Item.inc +++ b/inc/Item.inc @@ -20,6 +20,10 @@ class Item { $item->addChild("icon", $this->icon); $item->addChild("desc", $this->desc); } + + public static function fromXML($xml) { + return new static((string)$xml->name, +(string)$xml->cost /* convert to number */, (string)$xml->icon, (string)$xml->desc); + } } ?> -- cgit v1.2.3-54-g00ecf