20 package net.sf.gridarta.model.treasurelist;
22 import java.util.List;
23 import javax.swing.tree.DefaultMutableTreeNode;
24 import javax.swing.tree.MutableTreeNode;
25 import javax.swing.tree.TreeNode;
26 import net.
sf.japi.util.EnumerationIterator;
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
61 public MutableTreeNode
getClone(
final boolean processSecondLinking, @Nullable
final List<TreasureTreeNode> needSecondLink) {
66 for (
final TreeNode treasureTreeNode :
new EnumerationIterator<TreeNode>(children())) {
73 boolean hasChildren =
false;
74 for (
final TreeNode treasureTreeNode :
new EnumerationIterator<TreeNode>(children())) {
82 assert needSecondLink != null;
83 needSecondLink.add(clone);
113 final TreasureListTreasureObj treasureListTreasureObj = (TreasureListTreasureObj) content;
121 for (
final TreeNode treasureTreeNode :
new EnumerationIterator<TreeNode>(children())) {
126 final double corrector = 100.0 / (double) sumChances;
129 for (
final TreeNode treasureTreeNode :
new EnumerationIterator<TreeNode>(children())) {
MutableTreeNode getClone(final boolean processSecondLinking, @Nullable final List< TreasureTreeNode > needSecondLink)
Return a new cloned instance of this object.
boolean hasLoop
Set if thi list contains itself.
String getName()
Returns the name of this treasure object.
static final long serialVersionUID
Serial Version UID.
TreasureObj getTreasureObj()
String toString()
RefusedBequest
final boolean isTreasureList
Whether this treasure object is a "treasure" or "treasureone" object.
Type of TreasureListTreasureObj instances.
TreasureListTreasureObjType getListType()
Returns the list type.
A TreasureObj representing a "treasure" entry.
void recalculateChances()
Recalculate the chances of objects in a treasureone list.
TreasureTreeNode(@NotNull final TreasureObj content)
Construct tree node with specified content object.
void correctChance(final double corrector)
Updates the chance attribute by a corrector factor.
Subclass: Nodes in the CFTreasureListTree.
Subclass: UserObject (= content object) for nodes in the CFTreasureListTree These can be either treas...
int initChance()
Initializes the chance attribute.
final TreasureObj content
The treasure object of this node.