Package noppes.npcs.api.handler.data
Interface ILines
-
public interface ILinesA collection of dialog lines, supporting creation, indexed access, and random retrieval.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all lines.ILinecreateLine(String text)Creates and adds a new line with the given text.Integer[]getKeys()ILinegetLine(boolean isRandom)Returns a line, either randomly or sequentially.ILinegetLine(int lineIndex)Returns the line at the given index.booleanisEmpty()voidremoveLine(int lineIndex)Removes the line at the given index.voidsetLine(int lineIndex, ILine line)Sets the line at the given index.
-
-
-
Method Detail
-
createLine
ILine createLine(String text)
Creates and adds a new line with the given text.- Parameters:
text- the line text.- Returns:
- the created line.
-
getLine
ILine getLine(boolean isRandom)
Returns a line, either randomly or sequentially.- Parameters:
isRandom- true to return a random line; false for sequential.- Returns:
- the selected line, or null if empty.
-
getLine
ILine getLine(int lineIndex)
Returns the line at the given index.- Parameters:
lineIndex- the line index.- Returns:
- the line, or null if the index is invalid.
-
setLine
void setLine(int lineIndex, ILine line)Sets the line at the given index.- Parameters:
lineIndex- the line index.line- the line to set.
-
removeLine
void removeLine(int lineIndex)
Removes the line at the given index.- Parameters:
lineIndex- the line index.
-
clear
void clear()
Removes all lines.
-
isEmpty
boolean isEmpty()
- Returns:
- true if there are no lines.
-
getKeys
Integer[] getKeys()
- Returns:
- the indices of all stored lines.
-
-