-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher White <[email protected]>
- Loading branch information
1 parent
0f6b60e
commit 62839b4
Showing
4 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
core/src/main/java/tc/oc/pgm/action/actions/TimeLimitAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package tc.oc.pgm.action.actions; | ||
|
||
import tc.oc.pgm.api.match.Match; | ||
import tc.oc.pgm.timelimit.TimeLimit; | ||
import tc.oc.pgm.timelimit.TimeLimitMatchModule; | ||
|
||
public class TimeLimitAction extends AbstractAction<Match> { | ||
private final TimeLimit timeLimit; | ||
|
||
public TimeLimitAction(TimeLimit timeLimit) { | ||
super(Match.class); | ||
this.timeLimit = timeLimit; | ||
} | ||
|
||
@Override | ||
public void trigger(Match match) { | ||
TimeLimitMatchModule time = match.needModule(TimeLimitMatchModule.class); | ||
time.cancel(); | ||
time.setTimeLimit(timeLimit); | ||
time.start(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters