From 3d59c6ceca1c5b05b304e1f8146e32d701a17acc Mon Sep 17 00:00:00 2001 From: piernov Date: Wed, 27 Apr 2016 20:02:28 +0200 Subject: Add addToXML() methods on Inventory and Item objects --- inc/Item.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc/Item.inc') 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); + } } ?> -- cgit v1.2.3-54-g00ecf