Package svs_demogame :: Module terrain :: Class TerrainArea
[show private | hide private]
[frames | no frames]

Class TerrainArea

ScriptableEntity --+
                   |
                  TerrainArea

Known Subclasses:
BoundaryArea

Area within terrain capable of being scripted.
Method Summary
  __init__(self, terrain, indexX, indexY)
  addOccupant(self, occupant)
Adds an occupant to the list of occupants in area.
  agentEntered(self, agent)
Responds to agent entering area.
  agentExited(self, agent)
Responds to agent leaving area.
  executeAgentEnteredScript(self, agent)
Executes agentEntered handler in script attached to area.
  executeAgentExitedScript(self, agent)
Executes agentExited handler in script attached to area.
  executeScriptOnAgent(self, agent)
Executes the current script on the specified agent.
  executeStartPlayScript(self)
Executes startPlay handler in script attached to area.
  executeStopPlayScript(self)
Executes stopPlay handler in script attached to area.
  getDensity(self)
Returns the density value for the terrain area.
  getId(self)
Returns id for area.
Array getNeighbours(self, *directions, **kwargs)
Returns a list of areas which are adjacent to this area.
  getProfile(self)
Returns TerrainAreaProfile object for sending over network.
  getScriptIdentifier(self)
Returns a string name for the object that can be used by the ScriptHandler.
  hasOccupants(self)
Returns True if there are any occupants in area, otherwise False.
  isAccessible(self)
Checks if area has any occupants or if density is 1.0, in which case it cannot be entered by an agent.
  removeOccupant(self, occupant)
Removes an occupant to the list of occupants in area.
  setDensity(self, newValue)
Sets the density of the terrain area, making sure it falls within the range 0.0 - 1.0, and updating game views.
  setDimensions(self, dimX, dimY)
Sets new dimensions for area.
  setLocation(self, newPosX, newPosY)
Sets location of terrain area, making sure that it is within the bounds of the terrain.
  startPlay(self)
Called when play starts.
  stopPlay(self)
Called when play stops.
  update(self, timeInterval)
Updates area.
    Inherited from ScriptableEntity
  clearScripts(self)
Clears scripts associated with entity.
  executeScriptOnSelf(self)
Executes the current script on the entity itself.
  getScript(self, revNum)
Returns script associated with entity.
  getScriptCode(self, revNum)
Returns source code for script associated with entity.
  getScriptRevisionLog(self)
Returns revisions log for script associated with entity.
  setScript(self, script)
Sets current script associated with entity.

Method Details

addOccupant(self, occupant)

Adds an occupant to the list of occupants in area.

agentEntered(self, agent)

Responds to agent entering area.

agentExited(self, agent)

Responds to agent leaving area.

executeAgentEnteredScript(self, agent)

Executes agentEntered handler in script attached to area.

executeAgentExitedScript(self, agent)

Executes agentExited handler in script attached to area.

executeScriptOnAgent(self, agent)

Executes the current script on the specified agent.

executeStartPlayScript(self)

Executes startPlay handler in script attached to area.

executeStopPlayScript(self)

Executes stopPlay handler in script attached to area.

getDensity(self)

Returns the density value for the terrain area.

getId(self)

Returns id for area.

getNeighbours(self, *directions, **kwargs)

Returns a list of areas which are adjacent to this area.

If the directions are set these can be used to return only the neighbours in the specified directions. The directions are defined by compass names, 'N', 'S', 'E', 'W', 'NE', etc.
Returns:
Array

getProfile(self)

Returns TerrainAreaProfile object for sending over network.

getScriptIdentifier(self)

Returns a string name for the object that can be used by the ScriptHandler.
Overrides:
svs_demogame.base_entities.ScriptableEntity.getScriptIdentifier

hasOccupants(self)

Returns True if there are any occupants in area, otherwise False.

isAccessible(self)

Checks if area has any occupants or if density is 1.0, in which case it cannot be entered by an agent.

removeOccupant(self, occupant)

Removes an occupant to the list of occupants in area.

setDensity(self, newValue)

Sets the density of the terrain area, making sure it falls within the range 0.0 - 1.0, and updating game views.

setDimensions(self, dimX, dimY)

Sets new dimensions for area.

setLocation(self, newPosX, newPosY)

Sets location of terrain area, making sure that it is within the bounds of the terrain.

startPlay(self)

Called when play starts.

stopPlay(self)

Called when play stops.

update(self, timeInterval)

Updates area.

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