コード例 #1
0
ファイル: IMeshMap.cs プロジェクト: Radeg/dots_all-modes
 public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map)
 {
     this.cellDimensions = cellDimensions;
     this.map            = map;
     triangles2          = Triangles;
     vertexDirections2   = VertexDirections;
 }
コード例 #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();
            }
        }
コード例 #3
0
        public FlatTriMap(Vector2 cellDimensions) :
            base(cellDimensions)
        {
            var hexDimensions =
                new Vector2(cellDimensions.x, 4f / 3f * cellDimensions.y);

            baseMap = new PointyHexMap(hexDimensions);
        }
コード例 #4
0
ファイル: FlatTriMap.cs プロジェクト: ifalvarez/complices
        public FlatTriMap(Vector2 cellDimensions) :
            base(cellDimensions)
        {
            Vector2 hexDimensions = cellDimensions;

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

            baseMap = new PointyHexMap(hexDimensions);
        }
コード例 #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);
        }
コード例 #6
0
ファイル: IMeshMap.cs プロジェクト: pattyqubed/GameofTiles
 public PointyHexMeshMap(Vector2 cellDimensions, PointyHexMap map)
 {
     this.cellDimensions = cellDimensions;
     this.map            = map;
 }