Package com.cmput301w23t09.qrhunter
Class GameController
- java.lang.Object
-
- com.cmput301w23t09.qrhunter.GameController
-
public class GameController extends java.lang.ObjectThe 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 PlayergetActivePlayer()GameActivitygetActivity()Retrieve the GameActivity this controller controls.androidx.fragment.app.FragmentgetBody()Retrieve the current body fragment.androidx.fragment.app.DialogFragmentgetPopup()Retrieve the current popup dialog.voidsetBody(androidx.fragment.app.Fragment fragment)Set the current body fragment to another fragment or null to show no fragment.voidsetPopup(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.
-
-