public BotFactory(IBotMovementHandlerFactory botMovementHandlerFactory) { this.botMovementHandlerFactory = botMovementHandlerFactory; }
public RegularBot(Coordinates coordinates, CardinalPoint direction, IGameBoard board, IBotMovementHandlerFactory botMovementHandlerFactory) { this.board = board; if (!IsValidPosition(coordinates.X, coordinates.Y)) { throw new BotGameException($"Position out of board range: x:{coordinates.X} y:{coordinates.Y}"); } this.Position = new Position(coordinates, direction); this.botMovements = new List <IBotMovementHandler> { botMovementHandlerFactory.CreateMovement(BotMovement.Advance), botMovementHandlerFactory.CreateMovement(BotMovement.Rotate) }; }