Class GameController


  • public class GameController
    extends java.lang.Object
    The GameController handles controlling the content to be shown onscreen when viewing the GameActivity.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.