Repository navigation
Expand file tree
/
Copy pathAction.java
More file actions
60 lines (51 loc) · 1.64 KB
/
Copy pathAction.java
File metadata and controls
60 lines (51 loc) · 1.64 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
package com.abilityapi.sequenceapi.action;
import com.abilityapi.sequenceapi.SequenceContext;
import com.abilityapi.sequenceapi.action.condition.Condition;
import com.abilityapi.sequenceapi.action.condition.ConditionType;
/**
* Represents an action.
*/
public interface Action {
/**
* Adds a {@link Condition} to this {@link Action}.
*
* @param condition the condition
*/
void addCondition(final Condition condition);
/**
* Sets a delay to this {@link Action}.
*
* @param period the period of delay
*/
void setDelay(final int period);
/**
* Returns the delay period.
*
* @return the delay period
*/
int getDelay();
/**
* Applies all {@link ConditionType#NORMAL} {@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);
}