public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map) { this.cellDimensions = cellDimensions; this.map = map; triangles2 = Triangles; vertexDirections2 = VertexDirections; }
protected override IMap3D <PointyHexPoint> CreateMap() { switch (mapType) { case MapType.Hex: { var windowedMap = new PointyHexMap(cellDimensions.HadamardMul(CellSpacingFactor)) .WithWindow(CenterRect); return(GetAlignedMap(windowedMap)); } case MapType.Brick: { var windowedMap = new PointyBrickMap(cellDimensions.HadamardMul(CellSpacingFactor)) .WithWindow(CenterRect); return(GetAlignedMap(windowedMap)); } case MapType.Custom: { var map = GetCustomMap3D(); return(map); } default: throw new ArgumentOutOfRangeException(); } }
public FlatTriMap(Vector2 cellDimensions) : base(cellDimensions) { var hexDimensions = new Vector2(cellDimensions.x, 4f / 3f * cellDimensions.y); baseMap = new PointyHexMap(hexDimensions); }
public FlatTriMap(Vector2 cellDimensions) : base(cellDimensions) { Vector2 hexDimensions = cellDimensions; hexDimensions.y = 2 * hexDimensions.y / 1.5f; baseMap = new PointyHexMap(hexDimensions); }
protected override WindowedMap <PointyHexPoint> CreateWindowedMap() { WindowedMap <PointyHexPoint> windowedHexMap; float cellWidth; float cellHeight; Vector2 cellDimensions; switch (mapType) { case MapType.Hex: cellWidth = CellPrefab.Dimensions.x; cellHeight = CellPrefab.Dimensions.x / 69 * 80; cellDimensions = new Vector2(cellWidth, cellHeight); windowedHexMap = new PointyHexMap(cellDimensions.HadamardMul(CellSpacingFactor)) .WithWindow(CenterRect); break; case MapType.Brick: cellWidth = CellPrefab.Dimensions.x; cellHeight = CellPrefab.Dimensions.y; cellDimensions = new Vector2(cellWidth, cellHeight); windowedHexMap = new PointyBrickMap(cellDimensions.HadamardMul(CellSpacingFactor)) .WithWindow(CenterRect); break; case MapType.Custom: windowedHexMap = GetCustomMap(); break; default: throw new ArgumentOutOfRangeException(); } return(windowedHexMap); }
public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map) { this.cellDimensions = cellDimensions; this.map = map; }