Enum BoatType
- java.lang.Object
-
- java.lang.Enum<BoatType>
-
- com.dragonboatrace.entities.boats.BoatType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetAgility()Get the agility of the boat type.floatgetHealth()Get the health of the boat type.java.lang.StringgetImageSrc()Get the path of the image used for the texture.floatgetSpeed()Get the speed of the boat type.floatgetStamina()Get the stamina of the boat type.static BoatTypevalueOf(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.
-
-
-
Constructor Detail
-
BoatType
private BoatType(float health, float stamina, float agility, float speed, java.lang.String imageSrc)Creates a boat template that can define aBoat.- 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 namejava.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.
-
-