Skip to content

Commit

Permalink
Add identifier to enum methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ApocalypsjeNL committed Oct 24, 2023
1 parent 5009a52 commit f2491af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ public enum InputMode {
MOUSE,
TOUCH,
GAMEPAD,
MOTION_CONTROLLER
MOTION_CONTROLLER;

private static final InputMode[] VALUES = values();

public static InputMode from(int id) {
return VALUES[id];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ public enum AnimatedTextureType {
NONE,
FACE,
BODY_32X32,
BODY_128X128
BODY_128X128;

private static final AnimatedTextureType[] VALUES = values();

public static AnimatedTextureType from(int id) {
return VALUES[id];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@

public enum AnimationExpressionType {
LINEAR,
BLINKING
BLINKING;

private static final AnimationExpressionType[] VALUES = values();

public static AnimationExpressionType from(int id) {
return VALUES[id];
}
}

0 comments on commit f2491af

Please sign in to comment.