UltimateTimber/src/main/java/com/songoda/ultimatetimber/animation/TreeAnimationType.java

25 lines
646 B
Java
Raw Normal View History

2019-03-30 04:59:10 +01:00
package com.songoda.ultimatetimber.animation;
2019-03-28 05:22:13 +01:00
/**
* The types of tree animations that are available
*/
public enum TreeAnimationType {
FANCY, DISINTEGRATE, CRUMBLE, NONE;
2019-04-28 04:04:45 +02:00
/**
* Gets a TreeAnimationType from a given string
*
* @param string The string
* @return The TreeAnimationType, returns FANCY if the string is an invalid type
*/
public static TreeAnimationType fromString(String string) {
for (TreeAnimationType value : values()) {
if (value.name().equalsIgnoreCase(string)) {
2019-04-28 04:04:45 +02:00
return value;
}
}
2019-04-28 04:04:45 +02:00
return TreeAnimationType.FANCY;
}
2019-03-28 05:22:13 +01:00
}