Exemple #1
0
 public static void addRecord() {
   byte[] bytes = SaverAndLoader.saveStateToMem();
   if (currentState == null) {
     currentState = new State(bytes);
     head.next = currentState;
     tail.prev = currentState;
     currentState.prev = head;
     currentState.next = tail;
   } else {
     State newState = new State(bytes);
     currentState.next = newState;
     tail.prev = newState;
     newState.prev = currentState;
     newState.next = tail;
     currentState = newState;
   }
 }
Exemple #2
0
 private static void gotoState(byte[] stateArray) {
   System.out.println("Switch state");
   SaverAndLoader.restoreStateFromMem(stateArray);
 }