-
Notifications
You must be signed in to change notification settings - Fork 0
Structure of the object
Ondolin edited this page Mar 7, 2021
·
1 revision
This API provides a JavaScript object, which contains lots of functions and information necessary for a frontend to display and interact with the current game state.
This API is meant to be used by developers. Therefore the following explanation assumes basic knowledge of the JavaScript (JS) programming language. (however, in-depth knowledge is not necessary)
(please note this is not syntactic correct JS code. This is just a collection of all variables and functions provided by the torchly
object. A more detailed explanation of the functions will follow in further chapters)
{
backend: {
URL: <string>
},
auth: {
authID: <string>,
playerID: <string>,
name: <string>,
gm: <boolean>,
},
players: {
array: <Player[]>,
getCharactersByPlayerID,
forceUpdatePlayers,
getByID,
subscriptionCallbacks,
unsubscribeChanges,
dataChanged,
add,
},
characters: {
array: <Character[]>,
add,
removeByID,
getByID,
forceUpdateCharacters,
subscribeChanges,
unsubscribeChanges,
},
initiative: {
array: <InitiativeValue[]>,
add,
remove,
getByID,
subscribeChanges,
unsubscribeChanges,
sort,
nextTurn,
},
config: {
vue: true,
},
closeConnections
}