Back to Documentation
Concept
Tags
Tag-based state management - flexible key-value system for game state
Tags are the fundamental state management mechanism in Chong. They provide a flexible, string-based system for storing and querying game state.
Tag Format
Tags follow the format: category:value or category:subcategory:value
locked:true # Boolean-like state
base:wild # Symbol type
coin:value:5 # Numeric value
position:multiplier:2 # Position property
payline:config1:1:3 # Complex identifierEntities
Tags are attached to entities. Common entity types:
| Entity Type | ID Format | Example |
|---|---|---|
| Position | pos_{col}_{row} | pos_0_1 |
| Symbol | s_{col}_{row} | s_1_2 |
| Global | global | global |
Tag Manager Operations
// Set a tag on an entity
tagManager.setTag('pos_0_0', 'locked:true')
// Check if entity has a tag
tagManager.hasTag('pos_0_0', 'locked:true')
// Get all tags for an entity
tagManager.getTags('pos_0_0')
// → ['locked:true', 'coin:value:5']
// Remove a tag
tagManager.removeTag('pos_0_0', 'locked:true')
// Find all entities with a tag
tagManager.getEntitiesByTag('locked:true')
// → ['pos_0_0', 'pos_1_2', 'pos_3_1']Common Tags
Position Tags
locked:true- Position is lockeddisabled:true- Position excluded from winscoin:value:{N}- Coin value (H&W)position:multiplier:{N}- Position multiplier
Symbol Tags
base:{type}- Base symbol typesymbol:{type}- Symbol identifierwinline:{N}- Part of winning line N
Global Tags
totalwin:{N}- Total win amounthnw:payout:{N}- H&W bonus payoutpaytable:{sym}_{count}_{value}- Paytable entry