summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/util/PauseTimer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland/fourpuzzle/util/PauseTimer.java')
-rw-r--r--src/com/fourisland/fourpuzzle/util/PauseTimer.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/util/PauseTimer.java b/src/com/fourisland/fourpuzzle/util/PauseTimer.java new file mode 100644 index 0000000..0e52b0f --- /dev/null +++ b/src/com/fourisland/fourpuzzle/util/PauseTimer.java
@@ -0,0 +1,41 @@
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package com.fourisland.fourpuzzle.util;
7
8/**
9 *
10 * @author hatkirby
11 */
12public class PauseTimer {
13
14 private int ticks;
15 public PauseTimer(int ticks)
16 {
17 this.ticks = ticks;
18 }
19
20 Interval in = Interval.createTickInterval(1);
21 public boolean isElapsed()
22 {
23 if (in.isElapsed())
24 {
25 if (ticks == 0)
26 {
27 return true;
28 } else {
29 ticks--;
30 }
31 }
32
33 return false;
34 }
35
36 public void setTimer(int ticks)
37 {
38 this.ticks = ticks;
39 }
40
41}