Esempio n. 1
0
 public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map)
 {
     this.cellDimensions = cellDimensions;
     this.map            = map;
     triangles2          = Triangles;
     vertexDirections2   = VertexDirections;
 }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        public FlatTriMap(Vector2 cellDimensions) :
            base(cellDimensions)
        {
            var hexDimensions =
                new Vector2(cellDimensions.x, 4f / 3f * cellDimensions.y);

            baseMap = new PointyHexMap(hexDimensions);
        }
Esempio n. 4
0
        public FlatTriMap(Vector2 cellDimensions) :
            base(cellDimensions)
        {
            Vector2 hexDimensions = cellDimensions;

            hexDimensions.y = 2 * hexDimensions.y / 1.5f;

            baseMap = new PointyHexMap(hexDimensions);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map)
 {
     this.cellDimensions = cellDimensions;
     this.map            = map;
 }