Package controller
Class UserController
java.lang.Object
controller.UserController
- All Implemented Interfaces:
IUserController
The controller for the user class in model
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreturns the username of the logged in userbooleanreturns true if the user is logged inbooleanreturns the score for the next wrong guessvoidlogout()logs out the user if logged inbooleanregisters a new user
-
Constructor Details
-
UserController
public UserController()constructor
-
-
Method Details
-
login
returns the score for the next wrong guess- Specified by:
loginin interfaceIUserController- Parameters:
username- the username of the userpassword- the password of the user- Returns:
- true if the user was successfully logged in
-
register
registers a new user- Specified by:
registerin interfaceIUserController- Parameters:
username- the username of the new userpassword- the password of the new user- Returns:
- true if the user was successfully registered
-
logout
public void logout()logs out the user if logged in- Specified by:
logoutin interfaceIUserController
-
isLoggedIn
public boolean isLoggedIn()returns true if the user is logged in- Specified by:
isLoggedInin interfaceIUserController- Returns:
- true if the user is logged in
-
getUsername
returns the username of the logged in user- Specified by:
getUsernamein interfaceIUserController- Returns:
- the username of the logged in user
-