Repository navigation
Expand file tree
/
Copy pathAction.java
More file actions
74 lines (63 loc) · 1.89 KB
/
Copy pathAction.java
File metadata and controls
74 lines (63 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.abilityapi.sequenceapi.action;
import com.abilityapi.sequenceapi.action.condition.Condition;
import com.abilityapi.sequenceapi.action.condition.ConditionType;
import com.abilityapi.sequenceapi.context.SequenceContext;
/**
* Represents an action.
*/
public interface Action {
/**
* Adds a {@link Condition} to this {@link Action}.
*
* @param condition the condition
*/
void addCondition(Condition condition);
/**
* Sets a delay to this {@link Action}.
*
* @param period the period of delay
*/
void setDelay(int period);
/**
* Sets an expire to this {@link Action}.
*
* @param period the period to expire
*/
void setExpire(int period);
/**
* Returns the delay period.
*
* @return the delay period
*/
int getDelay();
/**
* Returns the expire period.
*
* @return the expire period
*/
int getExpire();
/**
* Applies all {@link ConditionType#UNDEFINED} {@link Condition}s
* in this {@link Action} and returns the result of it.
*
* @param sequenceContext the sequence context
* @return true if all of them passed, false if any did not
*/
boolean apply(final SequenceContext sequenceContext);
/**
* Applies all {@link ConditionType#SUCCESS} {@link Condition}s
* in this {@link Action} and returns the result of it.
*
* @param sequenceContext the sequence context
* @return true if all of them passed, false if any did not
*/
boolean success(final SequenceContext sequenceContext);
/**
* Applies all {@link ConditionType#FAIL} {@link Condition}s
* in this {@link Action} and returns the result of it.
*
* @param sequenceContext the sequence context
* @return true if any of them passed, false if all did not
*/
boolean failure(final SequenceContext sequenceContext);
}