public bool Push(RobotCursor cursor) { if (buffer.Count >= limit) { throw new Exception("TOO MANY PUSHES WITHOUT POPS?"); } buffer.Add(cursor.GetSettings()); return(true); }
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); }
public Settings Pop(RobotCursor cursor) { if (buffer.Count > 0) { _settingsBeforeLastPopped = cursor.GetSettings(); _lastPoppped = buffer.Last(); buffer.RemoveAt(buffer.Count - 1); return(_lastPoppped); } return(null); }