コード例 #1
0
 internal BoardCreator (Square[,] grid) {
     Debug.Assert (grid != null);
     this.grid = grid;
     this.board = new Board (grid);
     this.width = board.Width;
     this.height = board.Height;
 }
コード例 #2
0
 public Board(Square[,] grid)
 {
 }
コード例 #3
0
 public void Link(Square neighbour, Direction dir)
 {
 }
コード例 #4
0
 // tag::createBoard[]
 public Board CreateBoard(Square[,] grid)
 {
     return new BoardCreator(grid).Create();
 }
コード例 #5
0
 private void SetLink(Square square, Direction dir, int x, int y)
 {
     int dirX = (width + x + dir.DeltaX) % width;
     int dirY = (height + y + dir.DeltaY) % height;
     Square neighbour = grid[dirX, dirY];
     square.Link(neighbour, dir);
 }