Class Portal

  • All Implemented Interfaces:
    Constants, java.lang.Runnable

    public class Portal
    extends Object
    implements Constants
    This class handles the portal functionality
    • Method Detail

      • getInstance

        public static Portal getInstance​(Scene scene,
                                         Cell cell)
        Create an instance of the portal
        Parameters:
        scene - The scene the portal is in
        cell - The cell the portal is in
        Returns:
        Returns the Portal instance
      • deleteInstance

        public void deleteInstance()
        Delete the Portal instance
      • purifyGems

        public void purifyGems()
        Purify the gems the player is carrying
      • setSound

        public void setSound​(Sound sound)
        Set the portal sound
        Parameters:
        sound - The portal sound
      • getState

        public Portal.State getState()
        Get the current state of the portal
        Returns:
        Returns the state of the portal
      • setState

        public void setState​(Portal.State state)
        Sets a new status for the portal
        Parameters:
        state - The new status
      • run

        public void run()
        This method is run when the thread starts
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class Object