Enums
There are properties in the Live Data Messages that are Enums, meaning they may have one of the predefined values.
Here's an example Schema of a buildingType property for Dota 2:
"buildingType" : {
"anyOf" : [
{
"type" : "null"
},
{
"type" : "string",
"enum" : [
"BARRACKS",
"TOWER",
"SHRINE",
"FILLER",
"ANCIENT",
"OUTPOST",
"UNKNOWN"
],
"title" : "BuildingType"
}
],
"description" : "Building type, e.g. TOWER, BARRACKS."
}
Some similar properties, however, are stored as Strings, even though they are essentially Enums. This is done to prevent things from breaking if there are changes in the data we receive: for example, if there was a new building type, or a new weapon type, or a new location.
You may want to set actions or additional checks on such values. Here's a list of some of such "Enums", that are represented as Strings in the schemas:
League of Legends
lane:undefinedtopmidbot
buildingType:undefinedturretturretPlateinhibitornexus
turretTier:outerinnerbasenexusfountain
monsterType:dragonbaronvileMawriftHeraldblueCampredCampscuttleCrabraptorgrompwolfkrugundefined
gameState: (only updated during draft phase)PRE_CHAMP_SELECTCHAMP_SELECTPOST_CHAMP_SELECT
killType:multiacefirstBloodshutdown
dragonType:airwaterfireearthelderhextechchemtech
wardType:sightvisionyellowTrinketyellowTrinketUpgradeexplorerteemoMushroomghostblueTrinketcontrolunknown
Counter-Strike: Global Offensive
side:TERRORISTCT