aboutsummaryrefslogtreecommitdiffstats
path: root/inc/Item.inc
diff options
context:
space:
mode:
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);
+ }
}
?>