-
Notifications
You must be signed in to change notification settings - Fork 10
OrderlyMap
youyihj edited this page Apr 16, 2023
·
1 revision
@since 1.13.0
The orderly map is a special associative array with predictable iteration order.
Add $orderly
suffix in map type declaration to call an orderly map.
// plain map
val map as string[string] = {
"test": "abc",
"foo": "bar",
"mine": "craft"
};
for key, value in map {
print(key ~ ": " ~ value);
}
/* results:
[INITIALIZATION][CLIENT][INFO] mine: craft
[INITIALIZATION][CLIENT][INFO] test: abc
[INITIALIZATION][CLIENT][INFO] foo: bar
*/
// orderly map
val orderlyMap as string[string]$orderly = {
"test": "abc",
"foo": "bar",
"mine": "craft"
};
for key, value in orderlyMap {
print(key ~ ": " ~ value);
}
/* results:
[INITIALIZATION][CLIENT][INFO] test: abc
[INITIALIZATION][CLIENT][INFO] foo: bar
[INITIALIZATION][CLIENT][INFO] mine: craft
*/
- GlobalFunctions
- ScriptReloading
- SuppressErrorPreprocessor
- HardFailPreprocessor
- OrderlyMap
- IData Deep Update
- Template String
- Native Method Access
- Mixin
- CrTI18n
- CrTUUID
- CrTItemHandler
- CrTLiquidHandler
- ILiquidTankProperties
- StringList
- HexHelper
- StaticString
- Catenation
- PersistedCatenation
- PlayerStat
- IStatFormatter
- GameRuleHelper
- ZenCommand
- ZenCommandTree
- ZenUtilsCommandSender
- IGetCommandUsage
- ICommandExecute
- IGetTabCompletion
- CommandUtils