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
:undefined
top
mid
bot
buildingType
:undefined
turret
turretPlate
inhibitor
nexus
turretTier
:outer
inner
base
nexus
fountain
monsterType
:dragon
baron
vileMaw
riftHerald
blueCamp
redCamp
scuttleCrab
raptor
gromp
wolf
krug
undefined
gameState
: (only updated during draft phase)PRE_CHAMP_SELECT
CHAMP_SELECT
POST_CHAMP_SELECT
killType
:multi
ace
firstBlood
shutdown
dragonType
:air
water
fire
earth
elder
hextech
chemtech
wardType
:sight
vision
yellowTrinket
yellowTrinketUpgrade
explorer
teemoMushroom
ghost
blueTrinket
control
unknown
Counter-Strike: Global Offensive
side
:TERRORIST
CT