Item

Represent an Item in the shop or in the Inventory.

package

inc\Item.inc

author

Alexandre Renoux

author

Pierre-Emmanuel Novac

Methods

Item's constructor

__construct(string $name, integer $cost, string $icon, string $desc, array $feat) : void

Arguments

$name

string

Item's name

$cost

integer

Item's cost

$icon

string

Item's icon

$desc

string

Item's description

$feat

array

associative array of strings describing the Item's features

Generates an XML tree describing the Item

addToXML( $root, integer $count) : void

Arguments

$root

$count

integer

numbers of Items

Applies Item's features on the player.

consume() : void

Generates an Item object from an XML tree

fromXML(\SimpleXMLElement $xml) : void
static

Arguments

$xml

\SimpleXMLElement

root XML element representing the Item

Properties

Name of the item.

name : string
var

Name of the item.

Type(s)

string

Item's cost.

cost : integer
var

Item's cost.

Type(s)

integer

Item's icon.

icon : string
var

Item's icon.

Type(s)

string

Item's description.

desc : string
var

Item's description.

Type(s)

string

Item's features as an associative array

feat : array
var

Item's features as an associative array

Type(s)

array