Package svs_demogame :: Module agents :: Class Agent
[show private | hide private]
[frames | no frames]

Class Agent

ScriptableEntity --+
                   |
                  Agent


Simple agent with steering capabilities, and able to respond to commands embedded in the terrain.
Method Summary
  __init__(self, name, terrain)
  checkObstacles(self)
Checks ahead of agent in terrain for obstacles.
  executeEnterAreaScript(self, area)
Executes enterArea handler in script attached to agent.
  executeExitAreaScript(self, area)
Executes exitArea handler in script attached to agent.
  executeStartPlayScript(self)
Executes startPlay handler in script attached to agent.
  executeStopPlayScript(self)
Executes stopPlay handler in script attached to agent.
  getName(self)
Returns name of agent.
  getProfile(self)
Returns AgentProfile object for sending over network.
  getScriptIdentifier(self)
Returns a string name for the object that can be used by the ScriptHandler.
  getSurroundingAreas(self)
Returns a list of areas surrounding agent.
  go(self, newSpeed, newFacing)
Changes agent to 'move' state, starts movement.
  move(self, deltaX, deltaY)
Moves agent by specified distances, making sure that it remains within the terrain.
  moveTowards(self, deltaX, deltaY)
Moves agent by specified distances and facing in that direction, making sure that it remains within the terrain.
  placeAt(self, newX, newY)
Places agent at new location.
  setDirection(self, newFacing)
Sets new facing direction for agent, making sure it is withing 360 degrees.
  setLocation(self, newPosX, newPosY)
Sets location of agent, making sure that it is within the bounds of the terrain.
  speed(self, newSpeed)
Sets new speed for agent.
  startPlay(self)
Called when play starts.
  stop(self)
Changes agent to 'rest' state, stops movement.
  stopPlay(self)
Called when play stops.
  turn(self, angle)
Turns agent by specified angle.
  turnTo(self, x, y)
Turns agent to face specified position.
  update(self, timeInterval)
Updates agent.
  updateLocation(self, timeInterval)
Updates location of agent.
  updateTerrainLocation(self)
Checks current location of agent in terrain to determine current terrain area of agent.
    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

checkObstacles(self)

Checks ahead of agent in terrain for obstacles.

executeEnterAreaScript(self, area)

Executes enterArea handler in script attached to agent.

executeExitAreaScript(self, area)

Executes exitArea handler in script attached to agent.

executeStartPlayScript(self)

Executes startPlay handler in script attached to agent.

executeStopPlayScript(self)

Executes stopPlay handler in script attached to agent.

getName(self)

Returns name of agent.

getProfile(self)

Returns AgentProfile object for sending over network.

getScriptIdentifier(self)

Returns a string name for the object that can be used by the ScriptHandler.

Overridden by extending class.
Overrides:
svs_demogame.base_entities.ScriptableEntity.getScriptIdentifier

getSurroundingAreas(self)

Returns a list of areas surrounding agent.

go(self, newSpeed=None, newFacing=None)

Changes agent to 'move' state, starts movement.

move(self, deltaX, deltaY)

Moves agent by specified distances, making sure that it remains within the terrain.

moveTowards(self, deltaX, deltaY)

Moves agent by specified distances and facing in that direction, making sure that it remains within the terrain.

placeAt(self, newX, newY)

Places agent at new location.

setDirection(self, newFacing)

Sets new facing direction for agent, making sure it is withing 360 degrees.

setLocation(self, newPosX, newPosY)

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

speed(self, newSpeed)

Sets new speed for agent.

startPlay(self)

Called when play starts.

stop(self)

Changes agent to 'rest' state, stops movement.

stopPlay(self)

Called when play stops.

turn(self, angle)

Turns agent by specified angle.

turnTo(self, x, y)

Turns agent to face specified position.

update(self, timeInterval)

Updates agent.

updateLocation(self, timeInterval)

Updates location of agent.

updateTerrainLocation(self)

Checks current location of agent in terrain to determine current terrain area of agent.

This method is called within the main update loop and is used to call enterArea and exitArea methods.

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