Enum Class StructurePlaceAnimator.AnimatorTime

java.lang.Object
java.lang.Enum<StructurePlaceAnimator.AnimatorTime>
fr.rodofire.ewc.shape.block.placer.animator.StructurePlaceAnimator.AnimatorTime
All Implemented Interfaces:
Serializable, Comparable<StructurePlaceAnimator.AnimatorTime>, Constable
Enclosing class:
StructurePlaceAnimator

public static enum StructurePlaceAnimator.AnimatorTime extends Enum<StructurePlaceAnimator.AnimatorTime>
enum to determine how much time the structure will be placed.
  • Enum Constant Details

    • CONSTANT_BLOCKS_PER_TICK

      public static final StructurePlaceAnimator.AnimatorTime CONSTANT_BLOCKS_PER_TICK
      Determines a defined number of blocks per tick. Each tick, a number of blockPerTick will be placed. You then have to specify blockPerTick
    • LINEAR_BLOCK_PER_TICK

      public static final StructurePlaceAnimator.AnimatorTime LINEAR_BLOCK_PER_TICK
      Will place an increasing (or decreasing) number of blocks per ticks linearly. You will have to specify the number of blockPerTicks that will be used based on the following principle:
      • tick0 -> zero blocks placed
      • tick1 -> blockPerTick blocks placed
      • tick2 -> 2 * blockPerTick blocks placed

        ...

      • tickN-1 -> (N-1) * blockPerTick blocks placed
      • tickN -> min(N * blockPerTick blocks placed, remaining blocks)
      to init the animator, You simply have to specify the number of BlockPerTicks
    • QUADRATIC_BLOCK_PER_TICK

      public static final StructurePlaceAnimator.AnimatorTime QUADRATIC_BLOCK_PER_TICK
      Will place an increasing (or decreasing) number of blocks per ticks that will grow on x². You will have to specify the number of blockPerTicks that will be used based on the following principle:
      • tick0 -> zero blocks placed
      • tick1 -> blockPerTick blocks placed
      • tick2 -> 4 * blockPerTick blocks placed (2*2)

        ...

      • tickN-1 -> (N-1) * (N-1) * blockPerTick blocks placed
      • tickN -> min(N * N * blockPerTick blocks placed, remaining blocks)

      to init the animator, You simply have to specify the number of BlockPerTicks
    • RANDOM_BLOCKS_PER_TICK

      public static final StructurePlaceAnimator.AnimatorTime RANDOM_BLOCKS_PER_TICK
      Will place a random number blocks every tick. For that you need to use the bounds:
           
           animator.setBounds(min_value, max_value);
           
       

      The animator will then choose a random number of blocks to place each tick.

      The random number chose will be contained between the min value and the max value. For example:

           
           //possible values : {5, 6, 7, 8, 9, 10}
           animator.setBounds(5,10);
           
       
    • CONSTANT_TICKS

      public static final StructurePlaceAnimator.AnimatorTime CONSTANT_TICKS

      Determines a fixed number of ticks to place the structure.

      For that, you need to specify the number of ticks: setTicks().

      The structure will then place a number of blockSize / ticks block each tick.

    • LINEAR_TICKS

      public static final StructurePlaceAnimator.AnimatorTime LINEAR_TICKS
      Will place an increasing (or decreasing) number of blocks per ticks linearly. You have to set a bound of blocks StructurePlaceAnimator.
      • The number of blocks that will be placed on the first tick is the first integer of the pair.
      • The last int of the pair represents the number of blocks that will be placed at the last tick.
      The related method will then calculate the coefficients that will determine how much blocks will be placed each tick.
    • QUADRATIC_TICKS

      public static final StructurePlaceAnimator.AnimatorTime QUADRATIC_TICKS
      Will place an increasing (or decreasing) number of blocks per ticks following a quadratic curve. You have to set a bound of blocks StructurePlaceAnimator.
      • The number of blocks that will be placed on the first tick is the first integer of the pair.
      • The last int of the pair represents the number of blocks that will be placed at the last tick.
      The related method will then calculate the coefficients that will determine how much blocks will be placed each tick.
  • Method Details

    • values

      public static StructurePlaceAnimator.AnimatorTime[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StructurePlaceAnimator.AnimatorTime valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null