Module gameobject
[hide private]
[frames] | no frames]

Module gameobject

source code

This module implements the (foundation) GameObject Class

Classes [hide private]
  GameObject
This is the base class for all artifacts, actors, and contexts.
Functions [hide private]
 
_lex(line)
helper function to lex a name and (potentially quoted) value from a line
source code
 
action_test()
basic test GameObject test cases
source code
 
weapon_test()
test for weapon actions and damage
source code
 
compound_test()
Test for attribute collection for compound actions
source code
 
accept_test()
tests for (non-ATTACK) accept_action()
source code
 
main()
Run all unit-test cases and print out summary of results
source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

_lex(line)

source code 

helper function to lex a name and (potentially quoted) value from a line

  • treat (single or double) quoted strings as a single token
  • if second token is an integer, return it as such, else a string
Parameters:
  • line - string to be lexed
Returns:
(name, value) ... or (None, None) for blank/comment lines