Package controller

Class UserController

java.lang.Object
controller.UserController
All Implemented Interfaces:
IUserController

public class UserController extends Object implements IUserController
The controller for the user class in model
  • Constructor Details

    • UserController

      public UserController()
      constructor
  • Method Details

    • login

      public boolean login(String username, String password)
      returns the score for the next wrong guess
      Specified by:
      login in interface IUserController
      Parameters:
      username - the username of the user
      password - the password of the user
      Returns:
      true if the user was successfully logged in
    • register

      public boolean register(String username, String password)
      registers a new user
      Specified by:
      register in interface IUserController
      Parameters:
      username - the username of the new user
      password - 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:
      logout in interface IUserController
    • isLoggedIn

      public boolean isLoggedIn()
      returns true if the user is logged in
      Specified by:
      isLoggedIn in interface IUserController
      Returns:
      true if the user is logged in
    • getUsername

      public String getUsername()
      returns the username of the logged in user
      Specified by:
      getUsername in interface IUserController
      Returns:
      the username of the logged in user