summaryrefslogtreecommitdiff
path: root/misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java
diff options
context:
space:
mode:
Diffstat (limited to 'misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java')
-rw-r--r--misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java63
1 files changed, 0 insertions, 63 deletions
diff --git a/misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java b/misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java
deleted file mode 100644
index 81fa6f2..0000000
--- a/misc/client/Piztor/src/com/macaroon/piztor/ActMgr.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.macaroon.piztor;
-
-import java.util.*;
-
-import android.annotation.SuppressLint;
-
-@SuppressLint("UseSparseArrays")
-public class ActMgr {
- // event
- PiztorAct act;
- ActStatus nowStatus;
- HashMap<ActStatus, HashMap<Integer, ActStatus>> mp;
-
- ActMgr(PiztorAct act, ActStatus nowStatus, ActStatus[] r) {
- this.act = act;
- this.nowStatus = nowStatus;
- mp = new HashMap<ActStatus, HashMap<Integer, ActStatus>>();
- for (int i = 0; i < r.length; i++) {
- mp.put(r[i], new HashMap<Integer, ActStatus>());
- }
- }
-
- void trigger(int event) {
- for (Integer i : mp.get(nowStatus).keySet())
- System.out.println(i);
- if (mp.get(nowStatus).containsKey(event)) {
- nowStatus.leave(event);
- nowStatus = mp.get(nowStatus).get(event);
- nowStatus.enter(event);
- } else if (AppMgr.mp.get(act.getClass()).containsKey(event)) {
- AppMgr.trigger(event);
- }
- }
-
- void add(ActStatus a, int event, ActStatus b) {
- if (mp.containsKey(a)) {
- HashMap<Integer, ActStatus> h = mp.get(a);
- h.put(event, b);
- mp.put(a, h);
- } else {
- HashMap<Integer, ActStatus> h = new HashMap<Integer, ActStatus>();
- h.put(event, b);
- mp.put(a, h);
- }
- }
-}
-
-abstract class ActStatus {
- abstract void enter(int e);
-
- abstract void leave(int e);
-}
-
-class EmptyStatus extends ActStatus {
- @Override
- void enter(int e) {
- }
-
- @Override
- void leave(int e) {
- }
-
-}