Enum BoatType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BoatType>

    public enum BoatType
    extends java.lang.Enum<BoatType>
    Represents a type of boat with predefined values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float agility  
      private float health  
      private java.lang.String imageSrc  
      private float speed  
      private float stamina  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BoatType​(float health, float stamina, float agility, float speed, java.lang.String imageSrc)
      Creates a boat template that can define a Boat.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getAgility()
      Get the agility of the boat type.
      float getHealth()
      Get the health of the boat type.
      java.lang.String getImageSrc()
      Get the path of the image used for the texture.
      float getSpeed()
      Get the speed of the boat type.
      float getStamina()
      Get the stamina of the boat type.
      static BoatType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static BoatType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • FAST

        public static final BoatType FAST
      • AGILE

        public static final BoatType AGILE
      • ENDURANCE

        public static final BoatType ENDURANCE
      • STRONG

        public static final BoatType STRONG
    • Field Detail

      • health

        private final float health
      • stamina

        private final float stamina
      • agility

        private final float agility
      • speed

        private final float speed
      • imageSrc

        private final java.lang.String imageSrc
    • Constructor Detail

      • BoatType

        private BoatType​(float health,
                         float stamina,
                         float agility,
                         float speed,
                         java.lang.String imageSrc)
        Creates a boat template that can define a Boat.
        Parameters:
        health - The health of the boat.
        stamina - The stamina of the boat.
        agility - The agility of the boat.
        speed - The speed of the boat.
        imageSrc - The path of the texture to use for the boat.
    • Method Detail

      • values

        public static BoatType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BoatType c : BoatType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BoatType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getHealth

        public float getHealth()
        Get the health of the boat type.
        Returns:
        A float of the boat type's health.
      • getStamina

        public float getStamina()
        Get the stamina of the boat type.
        Returns:
        A float of the boat type's stamina.
      • getAgility

        public float getAgility()
        Get the agility of the boat type.
        Returns:
        A float of the boat type's agility.
      • getSpeed

        public float getSpeed()
        Get the speed of the boat type.
        Returns:
        A float of the boat type's speed.
      • getImageSrc

        public java.lang.String getImageSrc()
        Get the path of the image used for the texture.
        Returns:
        A string of the path to the image used for the texture.