Package rekit.logic.level
Class Level
java.lang.Object
rekit.logic.level.Level
- All Implemented Interfaces:
Comparable<Level>,DataKeySetter
- Author:
- Dominik Fuchss
-
Method Summary
Modifier and TypeMethodDescriptionintvoidend(boolean won) This method shall be invoked whenILevelSceneends.booleanGet the current level's definition.intGet the highscore of this level.getLp()Get theLogicalPartof theLevel.getName()Get the name of the level.intgetScore()Get the current score of the level.getSp()Get theStructurePartof theLevel.booleanGet whether the game was successful.booleangetWon()Get whether the game was won.inthashCode()booleanIndicates whether the level is infinite.voidreset()Reset the level.
-
Method Details
-
end
public void end(boolean won) This method shall be invoked whenILevelSceneends. This will save all data like highscore.- Parameters:
won- indicates whether the level has been completed successfully
-
reset
public void reset()Reset the level. -
getLp
Get theLogicalPartof theLevel.- Returns:
- the
LogicalPart
-
getSp
Get theStructurePartof theLevel.- Returns:
- the
StructurePart
-
getName
Get the name of the level.- Returns:
- the name of the level
-
getHighScore
public int getHighScore()Get the highscore of this level.- Returns:
- the highscore
- See Also:
-
isInfinite
public boolean isInfinite()Indicates whether the level is infinite.- Returns:
trueiff infinite,falseotherwise- See Also:
-
getScore
public int getScore()Description copied from interface:DataKeySetterGet the current score of the level.- Specified by:
getScorein interfaceDataKeySetter- Returns:
- the score
- See Also:
-
getSuccess
public boolean getSuccess()Description copied from interface:DataKeySetterGet whether the game was successful.- Specified by:
getSuccessin interfaceDataKeySetter- Returns:
trueif success- See Also:
-
getWon
public boolean getWon()Description copied from interface:DataKeySetterGet whether the game was won.- Specified by:
getWonin interfaceDataKeySetter- Returns:
trueif won- See Also:
-
getDefinition
Description copied from interface:DataKeySetterGet the current level's definition.- Specified by:
getDefinitionin interfaceDataKeySetter- Returns:
- the definition
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Level>
-