aboutsummaryrefslogtreecommitdiffstats
path: root/inc/Item.inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-04-27 20:02:28 +0200
committerpiernov <piernov@piernov.org>2016-04-27 20:02:28 +0200
commit3d59c6ceca1c5b05b304e1f8146e32d701a17acc (patch)
tree53feeb76b2e32448995f363707fb12d601f82fa2 /inc/Item.inc
parent8bb2650b5d35dc5f47c8a46167dc2044638d1f4c (diff)
downloadcandybox-3d59c6ceca1c5b05b304e1f8146e32d701a17acc.tar.gz
candybox-3d59c6ceca1c5b05b304e1f8146e32d701a17acc.tar.bz2
candybox-3d59c6ceca1c5b05b304e1f8146e32d701a17acc.tar.xz
candybox-3d59c6ceca1c5b05b304e1f8146e32d701a17acc.zip
Add addToXML() methods on Inventory and Item objects
Diffstat (limited to 'inc/Item.inc')
-rw-r--r--inc/Item.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/inc/Item.inc b/inc/Item.inc
index bf77818..bef6d00 100644
--- a/inc/Item.inc
+++ b/inc/Item.inc
@@ -12,6 +12,14 @@ class Item {
$this->icon = $icon;
$this->desc = $desc;
}
+
+ function addToXML($root) {
+ $item = $root->addChild("item");
+ $item->addChild("name", $this->name);
+ $item->addChild("cost", $this->cost);
+ $item->addChild("icon", $this->icon);
+ $item->addChild("desc", $this->desc);
+ }
}
?>