예제 #1
0
 public bool Push(RobotCursor cursor)
 {
     if (buffer.Count >= limit)
     {
         throw new Exception("TOO MANY PUSHES WITHOUT POPS?");
     }
     buffer.Add(cursor.GetSettings());
     return(true);
 }
예제 #2
0
 public bool Push(RobotCursor cursor)
 {
     if (buffer.Count >= limit)
     {
         cursor.logger.Error("Too many Pushes without Pops?");
         throw new Exception("TOO MANY PUSHES WITHOUT POPS?");
     }
     buffer.Add(cursor.GetSettings());
     return(true);
 }
예제 #3
0
 public Settings Pop(RobotCursor cursor)
 {
     if (buffer.Count > 0)
     {
         _settingsBeforeLastPopped = cursor.GetSettings();
         _lastPoppped = buffer.Last();
         buffer.RemoveAt(buffer.Count - 1);
         return(_lastPoppped);
     }
     return(null);
 }