public void AddMove(Move m, bool clearQueue) { if (clearQueue) { _moves.Clear(); _currentMove = null; } _moves.Add(m); OnMovesUpdated?.Invoke(_moves, _currentMove); }
void SetCurrentCommand(Move m = null) { _currentMove = m; if (_currentMove != null) { _currentMove.Execute(); } else { _movePosition = null; _heading = null; } OnMovesUpdated?.Invoke(_moves, _currentMove); }