aboutsummaryrefslogtreecommitdiffstats
path: root/inc/Item.inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-01 14:52:43 +0200
committerpiernov <piernov@piernov.org>2016-05-01 14:52:43 +0200
commit76df4eb85cadf9cf548b4aa1cc95970e1d53f48d (patch)
tree8c4ef775860e6d5349b2a5e56b622c1ab6f9c7be /inc/Item.inc
parentcaf62cfe0e439fc13f7c297954c4aeb21112a2ec (diff)
downloadcandybox-76df4eb85cadf9cf548b4aa1cc95970e1d53f48d.tar.gz
candybox-76df4eb85cadf9cf548b4aa1cc95970e1d53f48d.tar.bz2
candybox-76df4eb85cadf9cf548b4aa1cc95970e1d53f48d.tar.xz
candybox-76df4eb85cadf9cf548b4aa1cc95970e1d53f48d.zip
Implement loading saved games on server
Diffstat (limited to 'inc/Item.inc')
-rw-r--r--inc/Item.inc4
1 files changed, 4 insertions, 0 deletions
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);
+ }
}
?>