Package com.cmput301w23t09.qrhunter
Class GameController
- java.lang.Object
-
- com.cmput301w23t09.qrhunter.GameController
-
public class GameController extends java.lang.Object
The GameController handles controlling the content to be shown onscreen when viewing the GameActivity.
-
-
Constructor Summary
Constructors Constructor Description GameController(GameActivity activity, Player activePlayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Player
getActivePlayer()
GameActivity
getActivity()
Retrieve the GameActivity this controller controls.androidx.fragment.app.Fragment
getBody()
Retrieve the current body fragment.androidx.fragment.app.DialogFragment
getPopup()
Retrieve the current popup dialog.void
setBody(androidx.fragment.app.Fragment fragment)
Set the current body fragment to another fragment or null to show no fragment.void
setPopup(androidx.fragment.app.DialogFragment dialog)
Change the current popup fragment.
-
-
-
Constructor Detail
-
GameController
public GameController(GameActivity activity, Player activePlayer)
-
-
Method Detail
-
getActivity
public GameActivity getActivity()
Retrieve the GameActivity this controller controls.- Returns:
- GameActivity
-
getActivePlayer
public Player getActivePlayer()
- Returns:
- The currently active player, the one playing the game.
-
getBody
public androidx.fragment.app.Fragment getBody()
Retrieve the current body fragment.- Returns:
- body fragment or null if none is set.
-
setBody
public void setBody(androidx.fragment.app.Fragment fragment)
Set the current body fragment to another fragment or null to show no fragment.- Parameters:
fragment
- fragment to display as the body of the screen.
-
getPopup
public androidx.fragment.app.DialogFragment getPopup()
Retrieve the current popup dialog.- Returns:
- current popup dialog.
-
setPopup
public void setPopup(androidx.fragment.app.DialogFragment dialog)
Change the current popup fragment.- Parameters:
dialog
- popup dialog to display on screen.
-
-