Class ChallengeAttempt
- java.lang.Object
-
- edu.cnm.deepdive.scalescroller.model.entity.ChallengeAttempt
-
- Direct Known Subclasses:
ChallengeAttemptWithPlayer
public class ChallengeAttempt extends Object
Holds data in the database for attempts of levels in Challenge mode.
-
-
Constructor Summary
Constructors Constructor Description ChallengeAttempt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCorrectCoins()
Returns the number of correct coins collected.long
getId()
Returns the auto-generated id for the Challenge level attempt.int
getIncorrectCoins()
Returns the number of incorrect coins collected.long
getLastScaleId()
Returns the id of the last scale attempted (i.e.long
getPlayerId()
Returns the player id associated with the Challenge level attempt.Date
getTimestamp()
Returns the timestamp when the attempt was completed/saved to the database.int
getTotalScore()
Returns the total score the player achieved in the Challenge level attempt.void
setCorrectCoins(int correctCoins)
Sets the number of correct coins collected.void
setId(long id)
Sets the auto-generated id for the Challenge level attempt.void
setIncorrectCoins(int incorrectCoins)
Sets the number of incorrect coins collected.void
setLastScaleId(long lastScaleId)
Sets the id of the last scale attempted (i.e.void
setPlayerId(long playerId)
Sets the player id associated with the Challenge level attempt.void
setTimestamp(Date timestamp)
Sets the timestamp when the attempt was completed/saved to the database.void
setTotalScore(int totalScore)
Sets the total score the player achieved in the Challenge level attempt.
-
-
-
Method Detail
-
getId
public long getId()
Returns the auto-generated id for the Challenge level attempt.- Returns:
- The id of the Challenge attempt.
-
setId
public void setId(long id)
Sets the auto-generated id for the Challenge level attempt.- Parameters:
id
- The id to be set.
-
getPlayerId
public long getPlayerId()
Returns the player id associated with the Challenge level attempt.- Returns:
- Returns the player's id.
-
setPlayerId
public void setPlayerId(long playerId)
Sets the player id associated with the Challenge level attempt.- Parameters:
playerId
- The player id to be set.
-
getTotalScore
public int getTotalScore()
Returns the total score the player achieved in the Challenge level attempt.- Returns:
- The total score achieved.
-
setTotalScore
public void setTotalScore(int totalScore)
Sets the total score the player achieved in the Challenge level attempt.- Parameters:
totalScore
- The total score achieved.
-
getTimestamp
@NonNull public Date getTimestamp()
Returns the timestamp when the attempt was completed/saved to the database.- Returns:
- The timestamp.
-
setTimestamp
public void setTimestamp(@NonNull Date timestamp)
Sets the timestamp when the attempt was completed/saved to the database.- Parameters:
timestamp
- The timestamp when the attempt was completed/saved.
-
getCorrectCoins
public int getCorrectCoins()
Returns the number of correct coins collected.- Returns:
- The total correct coins.
-
setCorrectCoins
public void setCorrectCoins(int correctCoins)
Sets the number of correct coins collected.- Parameters:
correctCoins
- The number of correct coins collected.
-
getIncorrectCoins
public int getIncorrectCoins()
Returns the number of incorrect coins collected.- Returns:
- The total incorrect coins.
-
setIncorrectCoins
public void setIncorrectCoins(int incorrectCoins)
Sets the number of incorrect coins collected.- Parameters:
incorrectCoins
- The number of incorrect coins collected.
-
getLastScaleId
public long getLastScaleId()
Returns the id of the last scale attempted (i.e. the scale that the player lost their last life on).- Returns:
- The id of the last scale attempted.
-
setLastScaleId
public void setLastScaleId(long lastScaleId)
Sets the id of the last scale attempted (i.e. the scale that the player lost their last life on).- Parameters:
lastScaleId
- The id of the last scale attempted.
-
-