Package de.murmelmeister.murmelapi.time
Class PlayTimeProvider
java.lang.Object
de.murmelmeister.murmelapi.time.PlayTimeProvider
- All Implemented Interfaces:
PlayTime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTime(int userId) Adds one unit of play time to the play time of a user with the given user ID.voidaddTime(int userId, PlayTimeType type, int time) Adds the specified amount of time to the play time of a user with the given user ID and play time type.voidcreateUser(int userId) Creates a new user with the given user ID.voiddeleteUser(int userId) Deletes a user with the given user ID from the database.booleanexistsUser(int userId) Checks if a user with the given user ID exists.intgetTime(int userId) Obtains the time for the given user ID and play time type.voidremoveTime(int userId) Removes one unit of play time from the play time of a user specified with the given user ID.voidremoveTime(int userId, PlayTimeType type, int time) Removes the specified amount of time from the play time of a user with the given user ID and play time type.voidresetTime(int userId) Resets the play time for a user with the given user ID to zero.voidsetTime(int userId, int time) Sets the play time for a user with the specified user ID.
-
Constructor Details
-
PlayTimeProvider
-
-
Method Details
-
existsUser
public boolean existsUser(int userId) Description copied from interface:PlayTimeChecks if a user with the given user ID exists.- Specified by:
existsUserin interfacePlayTime- Parameters:
userId- The ID of the user to check- Returns:
- true if a user with the given ID exists, false otherwise
-
createUser
public void createUser(int userId) Description copied from interface:PlayTimeCreates a new user with the given user ID.- Specified by:
createUserin interfacePlayTime- Parameters:
userId- The ID of the user to create
-
deleteUser
public void deleteUser(int userId) Description copied from interface:PlayTimeDeletes a user with the given user ID from the database.- Specified by:
deleteUserin interfacePlayTime- Parameters:
userId- The ID of the user to delete
-
getTime
public int getTime(int userId) Description copied from interface:PlayTimeObtains the time for the given user ID and play time type. -
setTime
public void setTime(int userId, int time) Description copied from interface:PlayTimeSets the play time for a user with the specified user ID. -
addTime
public void addTime(int userId) Description copied from interface:PlayTimeAdds one unit of play time to the play time of a user with the given user ID. -
addTime
Description copied from interface:PlayTimeAdds the specified amount of time to the play time of a user with the given user ID and play time type. -
removeTime
public void removeTime(int userId) Description copied from interface:PlayTimeRemoves one unit of play time from the play time of a user specified with the given user ID.- Specified by:
removeTimein interfacePlayTime- Parameters:
userId- The ID of the user whose play time will be decremented
-
removeTime
Description copied from interface:PlayTimeRemoves the specified amount of time from the play time of a user with the given user ID and play time type.- Specified by:
removeTimein interfacePlayTime- Parameters:
userId- The ID of the usertype- The type of play timetime- The amount of time to remove from the user's play time, in milliseconds
-
resetTime
public void resetTime(int userId) Description copied from interface:PlayTimeResets the play time for a user with the given user ID to zero.
-