示例#1
0
 public BotFactory(IBotMovementHandlerFactory botMovementHandlerFactory)
 {
     this.botMovementHandlerFactory = botMovementHandlerFactory;
 }
示例#2
0
        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)
            };
        }