Class StructurePart

java.lang.Object
rekit.logic.level.StructurePart

public class StructurePart extends Object
The structure part of a Level.
Author:
Dominik Fuchss
  • Field Details

    • unitsBuilt

      protected int unitsBuilt
    • random

      protected final Random random
  • Method Details

    • generate

      public final void generate(int max)
      Build Structures if it must. This decision depends on the Structures build so far and the parameter max that specifies which x position is the smallest that needs to be generated at.
      Parameters:
      max - the lowest x position that must still be generated at.
    • next

      protected Structure next()
      Get next structure.
      Returns:
      the next structure
    • getInitialStructure

      protected Structure getInitialStructure()

      Used to hold and get the first Structure that will always be the first Structure to be returned by next().

      Is thought to give the Player an easier start and to prevent him from spawning in an Enemy or even an Inanimate.

      Returns:
      the first Structure to be returned by next().
    • getEndStructure

      protected Structure getEndStructure()

      Used to hold and get the last Structure that will be the last Structure to be returned by next() before hasNext() indicates that there are no more Structures to be returned.
      Since this never happens on levels that have the setting infinite set (to anything other then 0), this method will never be called in these levels.

      Is thought to give the Player a characteristic ending and to add a InanimateTrigger that effectively ends the level upon collision.

      Returns:
      the (optional) last Structure to be returned by next().