Class Gem

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

    public class Gem
    extends Object
    This class contains the gem
    • Constructor Detail

      • Gem

        public Gem​(Scene scene,
                   Cell cell)
        Initialize the gem object
        Parameters:
        scene - The scene the gem is in
        cell - The cell the gem is in
    • Method Detail

      • getAnimationWidth

        public int getAnimationWidth()
        Get the width of the gem animation
        Returns:
        Returns the gem animation width
      • setSound

        public void setSound​(Sound sound)
        Set the gem sound
        Parameters:
        sound - The gem sound
      • playGemSound

        public void playGemSound()
        Play the gem sound
      • setType

        public void setType​(Gem.Type type)
        Set the gem type
        Parameters:
        type - The type of gem
      • getState

        public Gem.State getState()
        Get the current state of the gem
        Returns:
        Returns the state of the gem
      • setState

        public void setState​(Gem.State state)
        Set the state of the gem
        Parameters:
        state - The new state
      • 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