 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.treasurelist;
22 import java.io.Serializable;
23 import org.jetbrains.annotations.NotNull;
42 public static final int UNSET = -1;
105 final StringBuilder sb =
new StringBuilder();
107 sb.append(
nrof).append(
" ");
112 sb.append(
" +").append(
magic);
115 sb.append(
" (").append(
chance).append(
" %)");
117 return sb.toString();
125 protected abstract void appendToString(@NotNull StringBuilder sb);
Interface for visitors of TreasureObj instances.
void setMagic(final int magic)
Sets the magic attribute.
static final long serialVersionUID
The serial version UID.
String getName()
Returns the name of this treasure object.
int nrof
The maximum number of generated items.
abstract void copyListType(@NotNull TreasureObj treasureObj)
Copes the list type of a treasureone list.
static final int UNSET
Unset values.
Subclass: UserObject (= content object) for nodes in the CFTreasureListTree These can be either treas...
boolean isTreasureList()
Returns whether this treasure object is a "treasure" or "treasureone" object.
abstract void appendToString(@NotNull StringBuilder sb)
Appends a description of this treasure object to a {}.
void setHasLoop(final boolean hasLoop)
Sets whether this treasure object contains itself.
final boolean isRealChild
Set for all except yes or no nodes.
int getChance()
Returns the chance attribute.
void setChance(final int value)
Sets the chance attribute.
final String name
The name of this treasure object.
boolean hasLoop
Set if thi list contains itself.
int chance
The chance attribute.
boolean hasLoop()
Returns whether this treasure object contains itself.
int magic
The maximum magic bonus.
void setNrof(final int nrof)
Sets the maximum number of generated items.
final boolean isTreasureList
Whether this treasure object is a "treasure" or "treasureone" object.
void correctChance(final double corrector)
Updates the chance attribute by a corrector factor.
boolean isRealChild()
Returns whether this node is no a yes or no node.
abstract void visit(@NotNull TreasureObjVisitor visitor)
Calls the TreasureObjVisitor callback function appropriate for this instance.
int initChance()
Initializes the chance attribute.
int getMagic()
Returns the magic attribute.
TreasureObj(@NotNull final String name, final boolean isTreasureList, final boolean isRealChild)
Creates a new instance.