Exemplo n.º 1
0
 public void Record()
 {
     if (state == MemoryRecordingState.ready)
     {
         savedMemoriesCount++;
         robot.settings.saveString("currentSavedMemories", savedMemoriesCount + "");
         working = new Memory(getFilenameFromID(savedMemoriesCount));
         working.saveToDisk();
         state = MemoryRecordingState.recording;
         robot.updateMemoryState("recording: " + savedMemoriesCount);
     }
 }
Exemplo n.º 2
0
 public void Play()
 {
     if (state == MemoryRecordingState.ready)
     {
         for (; playedMemoryID < availableMemories.Count; playedMemoryID++)
         {
             working = Memory.loadFromDisk(availableMemories[playedMemoryID]);
             if (working != null)
             {
                 playTick = 0;
                 state    = MemoryRecordingState.playback;
                 robot.updateMemoryState("Playback: " + savedMemoriesCount);
                 break;
             }
         }
     }
 }
Exemplo n.º 3
0
        public void Stop()
        {
            if (state == MemoryRecordingState.recording)
            {
                state = MemoryRecordingState.stopping;
                working.saveToDisk();
                robot.updateMemoryState("stopping: " + savedMemoriesCount + " after " + working.totalTimeSeconds);
                working = null;
                state   = MemoryRecordingState.ready;
            }

            if (state == MemoryRecordingState.playback)
            {
                working = null;
                state   = MemoryRecordingState.ready;
            }
        }