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(); } }
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); }