Module gamecontext :: Class TestObject
[hide private]
[frames] | no frames]

Class TestObject

source code


A TestObject is a hidden object that will be found after a specified number of searches.

Instance Methods [hide private]
 
__init__(self, name, searches)
a TestObject will be hidden for a specified number of searches, after which it will be found
source code
 
accept_action(self, action, actor, context)
receive and process the effects of an action
source code

Inherited from gameobject.GameObject: __str__, add_object, get_object, get_objects, load, possible_actions

Inherited from base.Base: get, set

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

Instance Variables [hide private]

Inherited from gameobject.GameObject: objects

Inherited from base.Base: attributes, description, name

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, searches)
(Constructor)

source code 

a TestObject will be hidden for a specified number of searches, after which it will be found

Parameters:
  • name - (string) name of the object
  • searches - (int) number of searches to find it
Overrides: object.__init__

accept_action(self, action, actor, context)

source code 

receive and process the effects of an action

The only verb supported by this test class is SEARCH, which will succeed after a specified number of tries

Parameters:
  • action - GameAction being performed
  • actor - GameActor initiating the action
  • context - GameContext in which the action is happening
Returns:
(boolean success, string description of the effect)
Overrides: gameobject.GameObject.accept_action