Class TreasureObj

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int UNSET
      Unset values.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TreasureObj​(@NotNull java.lang.String name, boolean isTreasureList, boolean isRealChild)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void appendToString​(@NotNull java.lang.StringBuilder sb)
      Appends a description of this treasure object to a StringBuilder.
      abstract void copyListType​(@NotNull TreasureObj treasureObj)
      Copes the list type of a treasureone list.
      void correctChance​(double corrector)
      Updates the chance attribute by a corrector factor.
      int getChance()
      Returns the chance attribute.
      int getMagic()
      Returns the magic attribute.
      @NotNull java.lang.String getName()
      Returns the name of this treasure object.
      boolean hasLoop()
      Returns whether this treasure object contains itself.
      int initChance()
      Initializes the chance attribute.
      boolean isRealChild()
      Returns whether this node is no a yes or no node.
      boolean isTreasureList()
      Returns whether this treasure object is a "treasure" or "treasureone" object.
      void setChance​(int value)
      Sets the chance attribute.
      void setHasLoop​(boolean hasLoop)
      Sets whether this treasure object contains itself.
      void setMagic​(int magic)
      Sets the magic attribute.
      void setNrof​(int nrof)
      Sets the maximum number of generated items.
      @NotNull java.lang.String toString()  
      abstract void visit​(@NotNull TreasureObjVisitor visitor)
      Calls the TreasureObjVisitor callback function appropriate for this instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TreasureObj

        protected TreasureObj​(@NotNull
                              @NotNull java.lang.String name,
                              boolean isTreasureList,
                              boolean isRealChild)
        Creates a new instance.
        Parameters:
        name - the name of this treasure object
        isTreasureList - set for treasure or treasureone
        isRealChild - set for all except yes or no nodes
    • Method Detail

      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • appendToString

        protected abstract void appendToString​(@NotNull
                                               @NotNull java.lang.StringBuilder sb)
        Appends a description of this treasure object to a StringBuilder.
        Parameters:
        sb - the string builder
      • setChance

        public void setChance​(int value)
        Sets the chance attribute.
        Parameters:
        value - the chance attribute
      • getChance

        public int getChance()
        Returns the chance attribute.
        Returns:
        the chance attribute
      • initChance

        public int initChance()
        Initializes the chance attribute.
        Returns:
        the chance attribute
      • correctChance

        public void correctChance​(double corrector)
        Updates the chance attribute by a corrector factor.
        Parameters:
        corrector - the corrector factor
      • setMagic

        public void setMagic​(int magic)
        Sets the magic attribute.
        Parameters:
        magic - the magic attribute
      • getMagic

        public int getMagic()
        Returns the magic attribute.
        Returns:
        the magic attribute
      • setNrof

        public void setNrof​(int nrof)
        Sets the maximum number of generated items.
        Parameters:
        nrof - the maximum number
      • hasLoop

        public boolean hasLoop()
        Returns whether this treasure object contains itself.
        Returns:
        whether this treasure object contains itself
      • setHasLoop

        public void setHasLoop​(boolean hasLoop)
        Sets whether this treasure object contains itself.
        Parameters:
        hasLoop - whether this treasure object contains itself
      • isTreasureList

        public boolean isTreasureList()
        Returns whether this treasure object is a "treasure" or "treasureone" object.
        Returns:
        whether this treasure object is a "treasure" or "treasureone" object
      • isRealChild

        public boolean isRealChild()
        Returns whether this node is no a yes or no node.
        Returns:
        whether this node is neither yes nor no
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Returns the name of this treasure object.
        Returns:
        the name of this treasure object
      • visit

        public abstract void visit​(@NotNull
                                   @NotNull TreasureObjVisitor visitor)
        Calls the TreasureObjVisitor callback function appropriate for this instance.
        Parameters:
        visitor - the visitor to call
      • copyListType

        public abstract void copyListType​(@NotNull
                                          @NotNull TreasureObj treasureObj)
        Copes the list type of a treasureone list.
        Parameters:
        treasureObj - the node to copy from