/// <summary> /// Raises the <see cref="Moved"/> event. /// </summary> /// <param name="e">The event args to pass to the event handler.</param> protected virtual void OnMoved(RobotMovedEventArgs e) { Moved?.Invoke(this, e); }
/// <summary> /// Executed when the robot has been issued a move command. /// </summary> /// <param name="sender">The sending robot.</param> /// <param name="e">The event args of the robot move.</param> void OnRobotMoved(object sender, RobotMovedEventArgs e) { lock (moves) { moves.Enqueue(e.MovementDirection); } }