Item

Inherits: object

Module: inventory

Brief Description

Represents an inventory item instance for storing and retrieving item properties.

Instance Methods

Item Item ( dict kwargs )
None set ( str keyword, str arg )
str get ( str keyword )

Description

Represents an item that can be stored in an inventory. The item takes in as many named arguments as necessary that describe it.

Instance Variables

  • dict kwargs - A list of keywords describing the item

Instance Method Descriptions

  • Item Item ( dict kwargs )

Construct a new inventory item with as many keyword arguments describing the item as needed.

  • None set ( str keyword, str arg )

Set the value for the keyword argument in kwargs.

  • str get ( str keyword )

Return the argument for the dictionary key keyword in kwargs. Returns None if the keyword is not in kwargs

Supported Magic Methods

  • str __str__ ( )

Returns kwargs as a string.