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 voidgenerate(int max) BuildStructuresif it must.protected StructureUsed to hold and get the lastStructurethat will be the lastStructureto be returned by next() before hasNext() indicates that there are no moreStructuresto be returned.protected Structureprotected Structurenext()Get next structure.
-
Field Details
-
unitsBuilt
protected int unitsBuilt -
random
-
-
Method Details
-
generate
public final void generate(int max) BuildStructuresif it must. This decision depends on theStructuresbuild 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
Structurethat will always be the firstStructureto be returned by next().Is thought to give the
Playeran easier start and to prevent him from spawning in anEnemyor even anInanimate.- Returns:
- the first
Structureto be returned by next().
-
getEndStructure
Used to hold and get the last
Structurethat will be the lastStructureto be returned by next() before hasNext() indicates that there are no moreStructuresto 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
Playera characteristic ending and to add aInanimateTriggerthat effectively ends the level upon collision.- Returns:
- the (optional) last
Structureto be returned by next().
-