Package forgottentowns.mod.api
Record Class ColonyNotice
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyNotice
- Record Components:
key- translation key in the sending mod's namespacearguments- at most eight short display values, such as captured names or formatted countsfocus- optional tile to center when the player clicks the alert or log entrytone- visual emphasis; all tones use the game's existing general notification sound
public record ColonyNotice(String key, List<String> arguments, ColonyContext.Position focus, ColonyNotice.Tone tone)
extends Record
A localized event-log message and transient alert, optionally focusing a world tile.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPresentation emphasis for an informational mod notification. -
Constructor Summary
ConstructorsConstructorDescriptionColonyNotice(String key, List<String> arguments, ColonyContext.Position focus, ColonyNotice.Tone tone) Copies arguments and validates message-size limits before crossing into the host. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.final booleanIndicates whether some other object is "equal to" this one.focus()Returns the value of thefocusrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.tone()Returns the value of thetonerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ColonyNotice
public ColonyNotice(String key, List<String> arguments, ColonyContext.Position focus, ColonyNotice.Tone tone) Copies arguments and validates message-size limits before crossing into the host. Key ownership, translation availability, and focus bounds are checked when the notice is posted.- Parameters:
key- nonblank translation key of at most 256 charactersarguments- at most eight nonnull strings of at most 256 characters eachfocus- optional camera destinationtone- required emphasis- Throws:
NullPointerException- if key, arguments, an argument or tone is nullIllegalArgumentException- if the key is blank/overlong, there are more than eight arguments, or any argument exceeds 256 UTF-16 characters
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
focus
Returns the value of thefocusrecord component.- Returns:
- the value of the
focusrecord component
-
tone
Returns the value of thetonerecord component.- Returns:
- the value of the
tonerecord component
-