ConditionalDictionaryBuilder
Hierarchy
- DictionaryBuilder
- ConditionalDictionaryBuilder
Index
Constructors
Properties
Methods
Constructors
constructor
Constructs a new ConditionalDictionaryBuilder instance with the given parent and condition.
Parameters
parent: DictionaryBuilder
The parent DictionaryBuilder instance
condition: boolean
The condition that should determine whether or not this builder adds entries.
Returns ConditionalDictionaryBuilder
Properties
inherited_children
inherited_condition
inherited_entries
_parent
inherited_targetIndex
Methods
inheritedasset
Adds a dictionary entry which identifies an asset - usually the asset being changed, but the tag can be customized.
Parameters
asset: Asset
The asset in question
optionaltag: string = "AssetName"
The tag to replace
optionalcraftName: string = ""
The name of the crafted item if applicable
Returns ConditionalDictionaryBuilder
inheritedbuild
Constructs a dictionary array from the data passed to this instance.
Returns ChatMessageDictionaryEntry[]
- The constructed dictionary
inheriteddestinationCharacter
Adds a DestinationCharacter dictionary entry
Parameters
character: Character
The character which should be referenced by the DestinationCharacter entry
Returns ConditionalDictionaryBuilder
inheriteddestinationCharacterName
Adds a DestinationCharacterName dictionary entry
Parameters
character: Character
The character which should be referenced by the DestinationCharacterName entry
Returns ConditionalDictionaryBuilder
endif
Returns the parent instance. Used to effectively end input to this builder.
Returns DictionaryBuilder
- The parent builder
inheritedfocusGroup
Adds a dictionary entry which identifies the focused group - the group that was acted upon to generate the message, if applicable.
Parameters
groupName: AssetGroupItemName
The name of the focus group
Returns ConditionalDictionaryBuilder
inheritedgroup
Adds a dictionary entry which identifies a given group.
Parameters
tag: string
The tag to use as the substitution
groupName: AssetGroupName
The name of the group
Returns ConditionalDictionaryBuilder
inheritedif
Creates and enters a child ConditionalDictionaryBuilder, whose entries are only added if the provided condition is truthy.
Parameters
condition: boolean
The condition to check
Returns ConditionalDictionaryBuilder
- The child ConditionalDictionaryBuilder instance
inheritedmapViewChangeKey
Adds a changeKey dictionary entry
Parameters
keys: (gold | silver | bronze)[]
giveKey: boolean
Returns ConditionalDictionaryBuilder
inheritedmapViewTeleport
Adds a teleport dictionary entry
Parameters
position: ChatRoomMapPos
The position to teleport to
Returns ConditionalDictionaryBuilder
inheritedmarkAutomatic
Marks the message as being automatically generated. Usually used by automated vibe changes. Those will get filtered out depending on the reciever's chat settings.
Returns ConditionalDictionaryBuilder
inheritedperformActivity
Adds an activity entry to the dictionary.
Parameters
name: ActivityName
The activity performed
group: AssetGroup
The group the activity is being performed on
optionalitem: Item
The item used to perform the activity
optionalcount: number = 1
The number of times the activity is done
Returns ConditionalDictionaryBuilder
inheritedshockIntensity
Adds a shock intensity entry.
Parameters
intensity: number
The intensity of the shock applied
Returns ConditionalDictionaryBuilder
inheritedsourceCharacter
Adds a SourceCharacter dictionary entry
Parameters
character: Character
The character which should be referenced by the SourceCharacter entry
Returns ConditionalDictionaryBuilder
inheritedsuctionLevel
Add a suction intensity entry
Parameters
intensity: number
The intensity of the suction applied
Returns ConditionalDictionaryBuilder
inheritedtargetCharacter
Adds a TargetCharacter dictionary entry
Parameters
character: Character
The character which should be referenced by the TargetCharacter entry
optionalindex: number
The target character index if there is more than one target character
Returns ConditionalDictionaryBuilder
inheritedtargetCharacterName
Adds a TargetCharacterName dictionary entry
Parameters
character: Character
The character which should be referenced by the TargetCharacterName entry
Returns ConditionalDictionaryBuilder
inheritedtext
Adds a text dictionary entry. This is a straightforward dictionary entry where the provided tag will be directly replaced by the given text.
Parameters
tag: string
The tag to replace
text: string
The text to replace the tag with
Returns ConditionalDictionaryBuilder
inheritedtextLookup
Adds a text lookup dictionary entry. A text lookup will be performed on the provided lookup text, and the resulting value will be used to replace the associated tag.
Parameters
tag: string
The tag to replace
lookupText: string
The text to look up and replace the tag with
Returns ConditionalDictionaryBuilder
A DictionaryBuilder class which adds its dictionary entries based on a boolean condition. If the condition evaluates to truthy, then it will behave exactly like a DictionaryBuilder. However, if the condition evaluates to falsy, then it will always build an empty array.