Progress: Documentation

This commit is contained in:
Jeremiah Billmann
2013-07-26 09:54:50 -04:00
parent e506aef5f6
commit 31271daf04
3 changed files with 30 additions and 6 deletions
+27 -3
View File
@@ -118,10 +118,13 @@ Type: object literal
GarageServerIO.getStates(callback([, playerState], [, entityState]))
```
**playerState**
**callback**
Type: function(playerStates, entityStates)
**playerStates**
Type: array of object literals
**entityState**
**entityStates**
Type: array of object literals
```js
@@ -172,13 +175,34 @@ GarageServerIO.stop()
```
```js
GarageServerIO.getPlayers() : [,{ id, state, [,input1], [,{ state, executionTime }] }]
GarageServerIO.getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
```
**id**
Type: string
**state**
Type: object literal
**inputs**
Type: array of object literals
**states**
Type: array of object literals
```js
GarageServerIO.getEntities() : [,{ id, state, [,{ state, executionTime }] }]
```
**id**
Type: string
**state**
Type: object literal
**states**
Type: array of object literals
```js
GarageServerIO.updatePlayerState(id, state)
```
+1 -1
View File
@@ -18,7 +18,7 @@ options = {
api methods
initializeGarageServer(path, options)
addInput(input)
getStates(callback([player1State, player2State, ...], [entity1State, entity2State, ...]))
getStates(callback([, playerState], [, entityState]))
getId() : playerid
sendServerEvent(data)
*/
+2 -2
View File
@@ -22,8 +22,8 @@ api methods
createGarageServer(io, options)
start()
stop()
getPlayers() : [{ id, state, [input1, input2,...], [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
getEntities() : [{ id, state, [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
getEntities() :[,{ id, state, [,{ state, executionTime }] }]
updatePlayerState(id, state)
updateEntityState(id, state)
addEntity(id)