コード例 #1
0
ファイル: Board.cs プロジェクト: cschrammel/Voracity-aspnet5
 public Board(int boardSize, PositionFinder positionFinder, SurroundingTileFinder tileFinder)
 {
     _boardSize = boardSize;
     _positionFinder = positionFinder;
     _tileFinder = tileFinder;
     _maxTiles = _boardSize*_boardSize;
     _tiles = new List<PositionedTile>();
     ResetTiles();
 }
コード例 #2
0
 private static void Main(string[] args)
 {
     Console.Clear();
     var positionFinder = new PositionFinder(_boardSize);
     var surroundingTileFinder = new SurroundingTileFinder(_boardSize, positionFinder);
     _gameEngine = new Game(new Board(_boardSize, positionFinder, surroundingTileFinder));
     while (_gameEngine.Board.AvailableMoves().Count > 0)
     {
         DrawBoard(_gameEngine.Board);
         ProcessInput();
     }
     DrawBoard(_gameEngine.Board);
     System.Console.WriteLine("\n\nGame Over.  Score: " + _gameEngine.Score() + ".  Press Enter to continue.");
     System.Console.ReadLine();
 }
コード例 #3
0
 public SurroundingTileFinder(int boardSize, PositionFinder positionFinder)
 {
     _boardSize = boardSize;
     _positionFinder = positionFinder;
 }