1
1
package net .onelitefeather .coris .door ;
2
2
3
3
/**
4
- * The enumeration contains each animation state which a door can be in.
4
+ * Represents the different animation states that a door can be in during its lifecycle.
5
+ * <p>
6
+ * This enum defines a finite state machine for door animations, allowing for proper
7
+ * state management and transition control. The states represent both static positions
8
+ * and dynamic transition phases of door movement.
9
+ * </p>
10
+ * <p>
11
+ * Typical state transitions follow this pattern:
12
+ * {@code IDLE → OPENING → OPENED → CLOSING → IDLE}
13
+ * </p>
14
+ * <p>
15
+ * The enum can be used for:
16
+ * <ul>
17
+ * <li>Controlling door animation timing and sequencing</li>
18
+ * <li>Preventing invalid state transitions (e.g., opening an already opening door)</li>
19
+ * <li>Synchronizing visual effects with door movement</li>
20
+ * <li>Managing sound effects and particle systems</li>
21
+ * </ul>
5
22
*
6
23
* @author theEvilReaper
7
24
* @version 1.0.0
8
25
* @since 0.1.0
9
26
*/
10
27
public enum AnimationState {
11
28
29
+ /**
30
+ * The door is in a resting state and not currently animating.
31
+ * <p>
32
+ * This is the default state for doors that are fully closed and stationary.
33
+ * From this state, a door can transition to {@link #OPENING} when activation occurs.
34
+ * </p>
35
+ */
12
36
IDLE ,
37
+
38
+ /**
39
+ * The door is currently in the process of opening.
40
+ * <p>
41
+ * This transitional state represents the animation phase where the door moves
42
+ * from closed to open position. During this state, the door should not accept
43
+ * new open commands but may accept close commands depending on implementation.
44
+ * </p>
45
+ */
13
46
OPENING ,
47
+
48
+ /**
49
+ * The door is fully open and stationary.
50
+ * <p>
51
+ * This state indicates that the opening animation has completed and the door
52
+ * is now in its fully opened position. From this state, the door can transition
53
+ * to {@link #CLOSING} when deactivation occurs or after a timeout period.
54
+ * </p>
55
+ */
14
56
OPENED ,
15
- CLOSING ,
16
- }
57
+
58
+ /**
59
+ * The door is currently in the process of closing.
60
+ * <p>
61
+ * This transitional state represents the animation phase where the door moves
62
+ * from open to closed position. During this state, the door should not accept
63
+ * new close commands but may accept open commands depending on implementation.
64
+ * </p>
65
+ */
66
+ CLOSING
67
+ }
0 commit comments