예제 #1
0
        protected override WindowedMap <PointyTriPoint> CreateWindowedMap()
        {
            WindowedMap <PointyTriPoint> windowedHexMap;

            float   cellWidth;
            float   cellHeight;
            Vector2 cellDimensions;

            switch (mapType)
            {
            case MapType.Tri:
                cellWidth      = CellPrefab.Dimensions.x;
                cellHeight     = CellPrefab.Dimensions.x / 69 * 80;
                cellDimensions = new Vector2(cellWidth, cellHeight);

                windowedHexMap = new PointyTriMap(cellDimensions.HadamardMul(CellSpacingFactor))
                                 .WithWindow(centerRect);
                break;

            case MapType.Custom:
                windowedHexMap = GetCustomMap();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(windowedHexMap);
        }
        protected override WindowedMap <PointyTriPoint> CreateWindowedMap()
        {
            WindowedMap <PointyTriPoint> windowedHexMap;

            switch (mapType)
            {
            case MapType.Tri:
                windowedHexMap = new PointyTriMap(cellPrefab.Dimensions)
                                 .WithWindow(centerRect);
                break;

            case MapType.Custom:
                windowedHexMap = GetCustomMap();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(windowedHexMap);
        }