Exemplo n.º 1
0
 public void RecordCommand(IReplayCommand command)
 {
     while (commandHistory.Count > counter)
     {
         commandHistory.RemoveAt(counter);
     }
     commandBuffer.Enqueue(command);
     commandHistory.Add(command);
 }
Exemplo n.º 2
0
 void init(string name)
 {
     this.name                  = name;
     commandBuffer              = new Queue <IReplayCommand>();
     commandHistory             = new List <IReplayCommand>();
     ReplaySystem.FrameHandler += delegate(object a, EventArgs e)
     {
         if (commandBuffer.Count > 0)
         {
             IReplayCommand command = commandBuffer.Dequeue();
             command.Record();
             commandHistory.Add(command);
             counter++;
         }
     };
 }