Ejemplo n.º 1
0
        private HexBoard(HexSize sizeHexes, HexSize gridSize, Func <HexSize, TPath> hexgridPath
                         , BoardStorageInitializer <THex, TPath> boardStorage
                         )
        {
            if (hexgridPath == null)
            {
                throw new ArgumentNullException("hexgridPath");
            }
            if (boardStorage == null)
            {
                throw new ArgumentNullException("boardStorage");
            }

            MapScale     = 1.00F;
            IsTransposed = false;
            MapSizeHexes = sizeHexes;
            GridSize     = gridSize;
            HexgridPath  = hexgridPath(gridSize);
            _boardHexes  = boardStorage();
        }
Ejemplo n.º 2
0
 /// <summary>Initializes the internal contents of <see cref="HexBoard{THex,TPath}"/> with landmarks as specified for pathfinding.</summary>
 /// <param name="sizeHexes">Extent in hexes of the board being initialized, as a <see cref="System.Drawing.Size"/>.</param>
 /// <param name="gridSize">Extent in pixels of the layout grid for the hexagons, as a <see cref="System.Drawing.Size"/>.</param>
 /// <param name="landmarkCoords"><see cref="IFastList{HexCoords}"/> of the hexes to be used as Path-Finding landmarks.</param>
 /// <param name="hexgridPath">Implementation of a graphics path for the hex border.</param>
 /// <param name="boardStorage">TODO</param>
 protected HexBoard(HexSize sizeHexes, HexSize gridSize, IFastList <HexCoords> landmarkCoords,
                    Func <HexSize, TPath> hexgridPath, BoardStorageInitializer <THex, TPath> boardStorage
                    ) : this(sizeHexes, gridSize, hexgridPath, boardStorage)
 {
     SetLandmarks(landmarkCoords);
 }