aboutsummaryrefslogtreecommitdiffstats
path: root/inc/Item.inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-03 10:28:50 +0200
committerpiernov <piernov@piernov.org>2016-05-03 10:28:50 +0200
commitb8112f72b322fe5bf7048ac76251c8c637b9fee2 (patch)
treedaf86f704f8e3246d54ae3eab2fa37aba9346dd5 /inc/Item.inc
parent6bff76321ab05d6193bc1d35327cb44128f9ed66 (diff)
parentadb3df3d85ee081fd961602397d11186de08fef0 (diff)
downloadcandybox-b8112f72b322fe5bf7048ac76251c8c637b9fee2.tar.gz
candybox-b8112f72b322fe5bf7048ac76251c8c637b9fee2.tar.bz2
candybox-b8112f72b322fe5bf7048ac76251c8c637b9fee2.tar.xz
candybox-b8112f72b322fe5bf7048ac76251c8c637b9fee2.zip
Merge branch 'feat/savegame' into piernov
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);
+ }
}
?>