Class Index | File Index

Classes


Class GameEngine


Defined in: game-engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Class GameEngine
Method Summary
Method Attributes Method Name and Description
 
addGame(game)
 
addListener(event, callback)
Add a event listener
 
addUser(user)
 
getGame(id)
 
getUser(id)
 
init()
Initialize the GameEngine.
 
onAbandon(clientId)
 
onAttackUnit(attackerId, defenderId, clientId)
 
 
onDisconnect(clientId)
 
onEndTurn(clientId)
 
onJoinGame(gameId, clientId)
 
onLogin(username, clientId)
 
onMoveUnit(unitId, toX, toY, clientId)
 
onUpdate(context)
 
Remove a event listener
 
sendGame(game, message)
 
sendUser(user, message)
 
Start the GameEngine.
 
trigger(event)
Call a event
Class Detail
GameEngine()
Class GameEngine
Author: Adrian Gaudebert - adrian@gaudebert.fr.
Method Detail
addGame(game)
Parameters:
game

addListener(event, callback)
Add a event listener
Parameters:
event
Name of event
callback
Nam of function which listens this event
Returns:
this

addUser(user)
Parameters:
user

getGame(id)
Parameters:
id

getUser(id)
Parameters:
id

init()
Initialize the GameEngine.
Returns:
this.

onAbandon(clientId)
Parameters:
clientId

onAttackUnit(attackerId, defenderId, clientId)
Parameters:
attackerId
defenderId
clientId

onConnectionOpen(client)
Parameters:
client

onDisconnect(clientId)
Parameters:
clientId

onEndTurn(clientId)
Parameters:
clientId

onJoinGame(gameId, clientId)
Parameters:
gameId
clientId

onLogin(username, clientId)
Parameters:
username
clientId

onMoveUnit(unitId, toX, toY, clientId)
Parameters:
unitId
toX
toY
clientId

onUpdate(context)
Parameters:
context

removeListener(event)
Remove a event listener
Parameters:
event
Name of event

sendGame(game, message)
Parameters:
game
message

sendUser(user, message)
Parameters:
user
message

start()
Start the GameEngine.
Returns:
this.

trigger(event)
Call a event
Parameters:
event
Name of event
Returns:
this

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Apr 05 2011 21:22:01 GMT+0200 (CEST)