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 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 event
      playerName - The Princess player to change
      settingsBuilder - The new settings for Princess to use
      See Also:
  • Method Details

    • process

      public void process(IGameManager gameManager)
      Description copied from interface: TriggeredActiveEvent
      This 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:
      process in interface TriggeredActiveEvent
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • trigger

      public Trigger trigger()
      Returns the value of the trigger record component.
      Specified by:
      trigger in interface TriggeredEvent
      Returns:
      the value of the trigger record component
    • playerName

      public String playerName()
      Returns the value of the playerName record component.
      Returns:
      the value of the playerName record component
    • settingsBuilder

      public PrincessSettingsBuilder settingsBuilder()
      Returns the value of the settingsBuilder record component.
      Returns:
      the value of the settingsBuilder record component