Package rekit.logic.level
Class StructurePart
java.lang.Object
rekit.logic.level.StructurePart
The structure part of a
Level
.- Author:
- Dominik Fuchss
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal void
generate
(int max) BuildStructures
if it must.protected Structure
Used to hold and get the lastStructure
that will be the lastStructure
to be returned by next() before hasNext() indicates that there are no moreStructures
to be returned.protected Structure
protected Structure
next()
Get next structure.
-
Field Details
-
unitsBuilt
protected int unitsBuilt -
random
-
-
Method Details
-
generate
public final void generate(int max) BuildStructures
if it must. This decision depends on theStructures
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
Get next structure.- Returns:
- the next structure
-
getInitialStructure
Used to hold and get the first
Structure
that will always be the firstStructure
to be returned by next().Is thought to give the
Player
an easier start and to prevent him from spawning in anEnemy
or even anInanimate
.- Returns:
- the first
Structure
to be returned by next().
-
getEndStructure
Used to hold and get the last
Structure
that will be the lastStructure
to be returned by next() before hasNext() indicates that there are no moreStructures
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 aInanimateTrigger
that effectively ends the level upon collision.- Returns:
- the (optional) last
Structure
to be returned by next().
-