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 TypeMethodDescriptionint
void
end
(boolean won) This method shall be invoked whenILevelScene
ends.boolean
Get the current level's definition.int
Get the highscore of this level.getLp()
Get theLogicalPart
of theLevel
.getName()
Get the name of the level.int
getScore()
Get the current score of the level.getSp()
Get theStructurePart
of theLevel
.boolean
Get whether the game was successful.boolean
getWon()
Get whether the game was won.int
hashCode()
boolean
Indicates whether the level is infinite.void
reset()
Reset the level.
-
Method Details
-
end
public void end(boolean won) This method shall be invoked whenILevelScene
ends. 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 theLogicalPart
of theLevel
.- Returns:
- the
LogicalPart
-
getSp
Get theStructurePart
of 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:
true
iff infinite,false
otherwise- See Also:
-
getScore
public int getScore()Description copied from interface:DataKeySetter
Get the current score of the level.- Specified by:
getScore
in interfaceDataKeySetter
- Returns:
- the score
- See Also:
-
getSuccess
public boolean getSuccess()Description copied from interface:DataKeySetter
Get whether the game was successful.- Specified by:
getSuccess
in interfaceDataKeySetter
- Returns:
true
if success- See Also:
-
getWon
public boolean getWon()Description copied from interface:DataKeySetter
Get whether the game was won.- Specified by:
getWon
in interfaceDataKeySetter
- Returns:
true
if won- See Also:
-
getDefinition
Description copied from interface:DataKeySetter
Get the current level's definition.- Specified by:
getDefinition
in interfaceDataKeySetter
- Returns:
- the definition
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Level>
-