Package svs_demogame :: Module gamesettings :: Class GameSettings
[show private | hide private]
[frames | no frames]

Class GameSettings


Class encapsulating settings for gameworld.
Method Summary
  __init__(self)
  addAgent(self, x, y, radius, facing, name, speed, script, agentObject)
Adds information about an agent.
  addAgentGroup(self, name, colour)
Adds a group that agents can join.
  addArea(self, index_x, index_y, density, script, areaObject)
Adds information about an area.
  addScript(self, name, code)
Adds a script that can be attached to an area or agent.
  applyScripts(self)
Applies scripts to areas and agents.
  loadFromFile(self, filepath, gameWorld)
Loads and parses XML file storing settings.
  setDefaultAgentValues(self, facing, speed, script)
Sets default values that can be applied to all agents.
  setDefaultAreaValues(self, density, script)
Sets default values that can be applied to all areas.

Method Details

addAgent(self, x=0.0, y=0.0, radius=1.0, facing=0.0, name=None, speed=0.0, script=None, agentObject=None)

Adds information about an agent.

addAgentGroup(self, name, colour)

Adds a group that agents can join.

addArea(self, index_x=0, index_y=0, density=0.0, script=None, areaObject=None)

Adds information about an area.

addScript(self, name, code)

Adds a script that can be attached to an area or agent.

applyScripts(self)

Applies scripts to areas and agents.

loadFromFile(self, filepath, gameWorld)

Loads and parses XML file storing settings.

Note: if the file is malformed this will throw errors which should be caught at a higher level.

setDefaultAgentValues(self, facing=0.0, speed=0.0, script=None)

Sets default values that can be applied to all agents.

setDefaultAreaValues(self, density=0.0, script=None)

Sets default values that can be applied to all areas.

Generated by Epydoc 2.1 on Thu Oct 20 15:30:27 2005 http://epydoc.sf.net