Package svs_demogame :: Module gameworld :: Class Gameworld
[show private | hide private]
[frames | no frames]

Class Gameworld


Method Summary
  __init__(self)
  addAgent(self, agent)
Adds agent to gameworld.
  addAgentGroup(self, groupName, groupColour)
Adds new agent group.
  createFromFile(self, filepath)
Creates a gameworld from data read in from external file.
  createTerrain(self, dimX, dimY, areasX, areasY)
Creates a gameworld of specified dimensions.
  getAgentWithId(self, areaId)
Returns agent with specified id number.
  getAreaAtIndices(self, index_x, index_y)
Returns area at specified index coordinates.
  getAreaWithId(self, areaId)
Returns area with specified id number.
  getChanges(self)
Get reported changes in game world.
  getModel(self)
Returns model of game world in current condition.
  reportChange(self, changeData, keyName)
Collects changes in condition of terrain and agents.
  start(self)
Starts gameworld.
  stop(self)
Stops gameworld.
  update(self)
Updates world and all active components.

Method Details

addAgent(self, agent)

Adds agent to gameworld.

Makes sure that the agent belongs to and fits within the gameworld terrain.

addAgentGroup(self, groupName, groupColour)

Adds new agent group.

See svs_demogame.agents.AgentGroupManager.addAgentGroup.

createFromFile(self, filepath)

Creates a gameworld from data read in from external file.

Reads settings from C{filepath} which should be
to a file containing the following:

Essential:

- dimensions of world
- number of areas in x and y axes
- number of agents at start
- start location for each agent

Optional:

- density values for areas

createTerrain(self, dimX, dimY, areasX, areasY)

Creates a gameworld of specified dimensions.

getAgentWithId(self, areaId)

Returns agent with specified id number.

getAreaAtIndices(self, index_x, index_y)

Returns area at specified index coordinates. If not found returns None.

getAreaWithId(self, areaId)

Returns area with specified id number.

getChanges(self)

Get reported changes in game world.

getModel(self)

Returns model of game world in current condition.

reportChange(self, changeData, keyName)

Collects changes in condition of terrain and agents.

start(self)

Starts gameworld.

stop(self)

Stops gameworld.

update(self)

Updates world and all active components.

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