Package fortuneengine :: Module GameInspect :: Class GameInspect
[hide private]
[frames] | no frames]

Class GameInspect

source code

object --+
         |
        GameInspect

GameInspect is a class that can inspect and modify object trees.

The top most object must be a dictionary

Instance Methods [hide private]
 
__init__(self, object_root)
Init function of the GameInspect class.
source code
 
drilldown_object(self, objectname)
Takes the objectname string and tries to find the object that it is representing and returns that object.
source code
 
set_eval(self, objectname, statement)
Sets the object referenced by objectname to a value returned by passing the string stored in the val parameter to an eval statement.
source code
 
set_str(self, objectname, val)
Sets the object referenced by objectname to a string passed into the val parameter.
source code
 
set_int(self, objectname, val)
Sets the object referenced by objectname to an integer passed into the val parameter.
source code
 
inspect_object(self, objectname)
Displays information about the object path it is passed
source code

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, object_root)
(Constructor)

source code 

Init function of the GameInspect class.

Parameters:
  • object_root - The root dictionary of the tree
Overrides: object.__init__

drilldown_object(self, objectname)

source code 

Takes the objectname string and tries to find the object that it is representing and returns that object.

Example: battle.enemy_list[1].sprite._images[1]

Parameters:
  • objectname - The string that represents the object's path.
Returns:
Returns the object requested
Raises:
  • Exception - Throws an Exception with the string being the path error.

set_eval(self, objectname, statement)

source code 

Sets the object referenced by objectname to a value returned by passing the string stored in the val parameter to an eval statement.

Parameters:
  • objectname - A string representation of the location of the object being inspected in relation to the game engine registered object.
  • statement - A string to be evaluated and set to the object.

set_str(self, objectname, val)

source code 

Sets the object referenced by objectname to a string passed into the val parameter.

Parameters:
  • objectname - A string representation of the location of the object being inspected in relation to the game engine registered object.
  • val - A string to be set as the value of the object.

set_int(self, objectname, val)

source code 

Sets the object referenced by objectname to an integer passed into the val parameter. It may be a string that holds the int as it will be type casted.

Parameters:
  • objectname - A string representation of the location of the object being inspected in relation to the game engine registered object.
  • val - An int/string containing an int to be set as the value of the object.

inspect_object(self, objectname)

source code 

Displays information about the object path it is passed

Parameters:
  • objectname - A string representation of the location of the object being inspected in relation to the game engine registered object.