ConditionalDictionaryBuilder
Hierarchy
- DictionaryBuilder
- ConditionalDictionaryBuilder
Index
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
_children
_condition
_entries
_parent
_targetIndex
Methods
asset
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
build
Constructs a dictionary array from the data passed to this instance.
Returns ChatMessageDictionaryEntry[]
- The constructed dictionary
destinationCharacter
Adds a DestinationCharacter dictionary entry
Parameters
character: Character
The character which should be referenced by the DestinationCharacter entry
Returns ConditionalDictionaryBuilder
destinationCharacterName
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
focusGroup
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
group
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
if
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
markAutomatic
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
performActivity
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 = null
The item used to perform the activity
optionalcount: number = 1
The number of times the activity is done
Returns ConditionalDictionaryBuilder
shockIntensity
Adds a shock intensity entry.
Parameters
intensity: number
The intensity of the shock applied
Returns ConditionalDictionaryBuilder
sourceCharacter
Adds a SourceCharacter dictionary entry
Parameters
character: Character
The character which should be referenced by the SourceCharacter entry
Returns ConditionalDictionaryBuilder
suctionLevel
Add a suction intensity entry
Parameters
intensity: number
The intensity of the suction applied
Returns ConditionalDictionaryBuilder
targetCharacter
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
targetCharacterName
Adds a TargetCharacterName dictionary entry
Parameters
character: Character
The character which should be referenced by the TargetCharacterName entry
Returns ConditionalDictionaryBuilder
text
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
textLookup
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.