public void Move() { IMoveStrategy strategy = MoveStrategies.Where(x => x.Direction == CurrentPosition.Direction).FirstOrDefault(); if (strategy != null) { strategy.Execute(this); } }
private void TryDoMove() { if (gameBoard?.PlayerIdWithTurn == playerId) { doingMove = true; Console.WriteLine("Trying to do move"); try { moveStrategy .Execute( playerId, gameId, gameBoard); } finally { doingMove = false; } } }
public virtual void Move() { MoveStrategy.Execute(); }