Package adventure :: Module item :: Class Item
[hide private]
[frames] | no frames]

Class Item

object --+
         |
        Item

The class Item represents items in a text adventure game. Each item has a name and a longer description.


Note: it is assumed (but not enforced by this class) that items have unique names. That is, no two items in a game world have the same name.

Instance Methods [hide private]
 
__init__(self, name, description)
Creates a new item with the given attributes.
string
get_name(self)
Returns the name of the item.
string
get_description(self)
Returns the description of the item.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, description)
(Constructor)

 

Creates a new item with the given attributes.

Parameters:
  • name (string) - item name
  • description (string) - item description
Overrides: object.__init__

get_name(self)

 

Returns the name of the item.

Returns: string
item name

get_description(self)

 

Returns the description of the item.

Returns: string
item description