Record Class TextPage
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.TextPage
- All Implemented Interfaces:
FoliosPageElement
public record TextPage(Optional<String> title, String text, List<TextPage.Item> elements, ElementLayout settings, boolean single, @Nullable Observed observed)
extends Record
implements FoliosPageElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn element of a page, how it is set there, and the source its text observes (null for none).Nested classes/interfaces inherited from interface FoliosPageElement
FoliosPageElement.Laid, FoliosPageElement.Part, FoliosPageElement.SpreadHalf -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextPage(Optional<String> title, String text, List<TextPage.Item> elements, ElementLayout settings, boolean single, @Nullable Observed observed) Creates an instance of aTextPagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionelements()Returns the value of theelementsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.items()The items this page is about: anywhere in the book, pressing one of them opens this page.lay(FoliosLayout layout) Sets the page out: one or more pages, each drawn on its own.What the page asks the player to do, if it is a quest: an entry with objectives shows how far along they are on its row, and a toast says when they are all done.@Nullable Observedobserved()Returns the value of theobservedrecord component.Words of the page a search should find it by.settings()Returns the value of thesettingsrecord component.booleansingle()Returns the value of thesinglerecord component.static TextPagesingle(FoliosPageElement element, ElementLayout settings, @Nullable Observed observed) A page of one element, set as its JSON says (it lays itself out as its type does when it can't be set so).booleanspread()Whether the page spreads over both pages of an open book: its laid pages then come in pairs, a left page and the right page beside it, and it starts on a left page (an empty page is put before it if need be).text()Returns the value of thetextrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.with(ElementLayout settings, @Nullable Observed observed) This page, set as its JSON says, its text observing a source (null for none).
-
Field Details
-
CODEC
-
-
Constructor Details
-
TextPage
public TextPage(Optional<String> title, String text, List<TextPage.Item> elements, ElementLayout settings, boolean single, @Nullable Observed observed) Creates an instance of aTextPagerecord class.- Parameters:
title- the value for thetitlerecord componenttext- the value for thetextrecord componentelements- the value for theelementsrecord componentsettings- the value for thesettingsrecord componentsingle- the value for thesinglerecord componentobserved- the value for theobservedrecord component
-
-
Method Details
-
single
public static TextPage single(FoliosPageElement element, ElementLayout settings, @Nullable Observed observed) A page of one element, set as its JSON says (it lays itself out as its type does when it can't be set so). -
with
This page, set as its JSON says, its text observing a source (null for none). -
lay
Description copied from interface:FoliosPageElementSets the page out: one or more pages, each drawn on its own.- Specified by:
layin interfaceFoliosPageElement
-
searchText
Description copied from interface:FoliosPageElementWords of the page a search should find it by.- Specified by:
searchTextin interfaceFoliosPageElement
-
spread
public boolean spread()Description copied from interface:FoliosPageElementWhether the page spreads over both pages of an open book: its laid pages then come in pairs, a left page and the right page beside it, and it starts on a left page (an empty page is put before it if need be).- Specified by:
spreadin interfaceFoliosPageElement
-
items
Description copied from interface:FoliosPageElementThe items this page is about: anywhere in the book, pressing one of them opens this page.- Specified by:
itemsin interfaceFoliosPageElement
-
objectives
Description copied from interface:FoliosPageElementWhat the page asks the player to do, if it is a quest: an entry with objectives shows how far along they are on its row, and a toast says when they are all done.- Specified by:
objectivesin interfaceFoliosPageElement
-
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
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
elements
Returns the value of theelementsrecord component.- Returns:
- the value of the
elementsrecord component
-
settings
Returns the value of thesettingsrecord component.- Returns:
- the value of the
settingsrecord component
-
single
public boolean single()Returns the value of thesinglerecord component.- Returns:
- the value of the
singlerecord component
-
observed
Returns the value of theobservedrecord component.- Returns:
- the value of the
observedrecord component
-