Package megamek.server.scriptedEvents
Record Class PrincessSettingsEvent
java.lang.Object
java.lang.Record
megamek.server.scriptedEvents.PrincessSettingsEvent
- All Implemented Interfaces:
TriggeredActiveEvent,TriggeredEvent
public record PrincessSettingsEvent(Trigger trigger, String playerName, PrincessSettingsBuilder settingsBuilder)
extends Record
implements TriggeredActiveEvent
-
Constructor Summary
ConstructorsConstructorDescriptionPrincessSettingsEvent(Trigger trigger, String playerName, PrincessSettingsBuilder settingsBuilder) Creates a scripted even that changes the Princess settings for the bot player with the given name to the given settings. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theplayerNamerecord component.voidprocess(IGameManager gameManager) This method is called when the Trigger of this event is satisfied (returns true).Returns the value of thesettingsBuilderrecord component.final StringtoString()Returns a string representation of this record class.trigger()Returns the value of thetriggerrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.server.scriptedEvents.TriggeredEvent
isGameEnding
-
Constructor Details
-
PrincessSettingsEvent
public PrincessSettingsEvent(Trigger trigger, String playerName, PrincessSettingsBuilder settingsBuilder) Creates a scripted even that changes the Princess settings for the bot player with the given name to the given settings. This event only works in TW games and will do nothing if no Princess settings are previously registered under the player name.- Parameters:
trigger- The trigger that activates this eventplayerName- The Princess player to changesettingsBuilder- The new settings for Princess to use- See Also:
-
-
Method Details
-
process
Description copied from interface:TriggeredActiveEventThis method is called when the Trigger of this event is satisfied (returns true). This method must fully work out whatever the event brings, including sending the necessary packets. The code of this method is essentially part of the GameManager's code.- Specified by:
processin interfaceTriggeredActiveEvent
-
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). -
trigger
Returns the value of thetriggerrecord component.- Specified by:
triggerin interfaceTriggeredEvent- Returns:
- the value of the
triggerrecord component
-
playerName
Returns the value of theplayerNamerecord component.- Returns:
- the value of the
playerNamerecord component
-
settingsBuilder
Returns the value of thesettingsBuilderrecord component.- Returns:
- the value of the
settingsBuilderrecord component
-