If you think the Android project mobius listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.sgtcodfish.mobiusListing.player;
//fromwww.java2s.comimport java.util.HashMap;
import com.badlogic.gdx.graphics.g2d.Animation;
/**
* <p>
* Holds the different animation states that the player can be in and contains
* helpers for generating related data structures.
* </p>
*
* @author Ashley Davis (SgtCoDFish)
*/publicenum HumanoidAnimationState {
STANDING, RUNNING, JUMPING, USING, MANIPULATING;
publicstatic HashMap<HumanoidAnimationState, Animation> makeAnimationMapFromAnimations(Animation standing,
Animation running, Animation jumping, Animation using, Animation manipulating) {
finalint numStates = HumanoidAnimationState.values().length;
HashMap<HumanoidAnimationState, Animation> animationMap = new HashMap<HumanoidAnimationState, Animation>(
numStates);
if (standing == null || running == null || jumping == null || using == null || manipulating == null) {
thrownew IllegalArgumentException("Null animation passed to makeAnimationMap");
}
animationMap.put(STANDING, standing);
animationMap.put(RUNNING, running);
animationMap.put(JUMPING, jumping);
animationMap.put(USING, using);
animationMap.put(MANIPULATING, manipulating);
return animationMap;
}
}