public void Setup() { _shipFactory = new ShipFactory(); _board = new Board(10, 10); _game = new Game(_board); _boardGenerator = new RandomBoardGenerator(_board); }
public static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; var consoleManager = new ConsoleManager(); var fontStyle = "MS Gothic"; consoleManager.SetFont(fontStyle); if (!Validator.IsArgumentsValid(args)) { throw new FormatException("Arguments must be in format <widthBoard> <heightBoard"); } var parser = new BoardParser(); var board = parser.Parse(args); var boardGenerators = new IBoardGenerator[] { new ChessBoardGenerator(), new EmptyBoardGenerator() }; var boardGenerator = boardGenerators .FirstOrDefault(b => b.CanGenerate(board.Width, board.Height)); var drawableBoard = boardGenerator.Generate(board.Width, board.Height); var chessBoard = new ConsoleBoard(consoleManager); chessBoard.Draw(drawableBoard); }
public SimulatorDouble( IStateFactory stateFactory, IEvaluator evaluator, IBoardGenerator generator) { this.stateFactory = stateFactory; this.evaluator = evaluator; this.generator = generator; }
public Game( IBoardGenerator boardGenerator, IFleetCommander fleetCommander, ICommentator commentator) { _boardGenerator = boardGenerator; _fleetCommander = fleetCommander; _commentator = commentator; }
public BattleshipController( IBoardGenerator boardGenerator, IShipsGenerator shipsGenerator, IBoardCache boardCache, IFieldToPointConverter fieldToPointConverter) { this.boardGenerator = boardGenerator; this.shipsGenerator = shipsGenerator; this.boardCache = boardCache; this.fieldToPointConverter = fieldToPointConverter; }
public GameManager( IBoardPrinter boardPrinter, IBoardManager boardManager, IBoardGenerator boardGenerator, IActionParser actionParser, IScoreManager scoreManager, User.User user) { _boardPrinter = boardPrinter; _boardManager = boardManager; _boardGenerator = boardGenerator; _actionParser = actionParser; _scoreManager = scoreManager; _user = user; _menuOptions = new StringBuilder() .AppendLine("--------------------------") .AppendLine("SELECT AN OPTION:") .AppendLine("S X Y - Select a cell in the x,y position") .AppendLine("F X Y - Flag a cell in the x,y position") .AppendLine("E - Exit the game") .AppendLine() .ToString(); }
public GameEngine(int size, IBoardGenerator boardGenerator) { this.size = size; generator = boardGenerator; gameState = new ICell[2][, ]; }
public BoardController(BoardSingletonRepo boardRepository, IBoardUpdater boardUpdater, IBoardGenerator boardGenerator) { _boardRepository = boardRepository; _boardUpdater = boardUpdater; _boardGenerator = boardGenerator; }
public void SetUp() { boardGenerator = new RandomBoardGenerator(); }
public Game(IBoardGenerator boardGenerator, GameConfig gameConfig) { _boardGenerator = boardGenerator; _gameConfig = gameConfig; _won = false; }
public GameProcessor(IBoardGenerator boardGenerator, IUserInterface userInterface, GameState gameState) { GameState = gameState; BoardGenerator = boardGenerator; UserInterface = userInterface; }