Example #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;
   }
 }