Record Class DialogBase
java.lang.Object
java.lang.Record
fr.fidorial.dialog.DialogBase
- Record Components:
title- the screen title, always visible whatever the dialog typeexternalTitle- the label of the button leading to this dialog from elsewhere, for instance the pause menu; falls back totitlewhen absentbody- the elements laid out between the title and the inputsinputs- the controls the player fills incanCloseWithEscape- whether the escape key dismisses the dialogpause- whether the dialog pauses a single-player game; irrelevant on a dedicated server but still part of the formatafterAction- what the client does with the screen once a button has been pressed
public record DialogBase(Component title, @Nullable Component externalTitle, List<DialogBody> body, List<DialogInput> inputs, boolean canCloseWithEscape, boolean pause, DialogAfterAction afterAction)
extends Record
- Since:
- 0.1.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDialogBase(Component title, @Nullable Component externalTitle, List<DialogBody> body, List<DialogInput> inputs, boolean canCloseWithEscape, boolean pause, DialogAfterAction afterAction) Creates an instance of aDialogBaserecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterActionrecord component.body()Returns the value of thebodyrecord component.static DialogBase.Builderbuilder(ComponentLike title) Starts building a dialog base.booleanReturns the value of thecanCloseWithEscaperecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexternalTitlerecord component.final inthashCode()Returns a hash code value for this object.inputs()Returns the value of theinputsrecord component.static DialogBaseof(ComponentLike title) Creates a bare dialog base carrying nothing but a title.booleanpause()Returns the value of thepauserecord component.title()Returns the value of thetitlerecord component.Returns a builder pre-filled with this base.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DialogBase
public DialogBase(Component title, @Nullable Component externalTitle, List<DialogBody> body, List<DialogInput> inputs, boolean canCloseWithEscape, boolean pause, DialogAfterAction afterAction) Creates an instance of aDialogBaserecord class.- Parameters:
title- the value for thetitlerecord componentexternalTitle- the value for theexternalTitlerecord componentbody- the value for thebodyrecord componentinputs- the value for theinputsrecord componentcanCloseWithEscape- the value for thecanCloseWithEscaperecord componentpause- the value for thepauserecord componentafterAction- the value for theafterActionrecord component
-
-
Method Details
-
of
Creates a bare dialog base carrying nothing but a title.- Parameters:
title- the screen title- Returns:
- the base
- Since:
- 0.1.0
-
builder
Starts building a dialog base.- Parameters:
title- the screen title- Returns:
- a fresh builder
- Since:
- 0.1.0
-
toBuilder
Returns a builder pre-filled with this base.- Returns:
- a builder pre-filled with this base
- Since:
- 0.1.0
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
title
-
externalTitle
Returns the value of theexternalTitlerecord component.- Returns:
- the value of the
externalTitlerecord component
-
body
-
inputs
-
canCloseWithEscape
public boolean canCloseWithEscape()Returns the value of thecanCloseWithEscaperecord component.- Returns:
- the value of the
canCloseWithEscaperecord component
-
pause
-
afterAction
Returns the value of theafterActionrecord component.- Returns:
- the value of the
afterActionrecord component
-