Пример #1
0
 public ChunkBorderInfo(bool isCorner, FalloffGenerator.Corner corner, bool isEdge, FalloffGenerator.Edge edge)
 {
     this.isCorner = isCorner;
     this.corner   = corner;
     this.isEdge   = isEdge;
     this.edge     = edge;
 }
Пример #2
0
    ChunkBorderInfo GetChunkBorderInfo()
    {
        bool isCorner = false;

        FalloffGenerator.Corner corner = FalloffGenerator.Corner.TOPLEFT;
        bool isEdge = false;

        FalloffGenerator.Edge edge = FalloffGenerator.Edge.TOP;

        Vector4 mapBounds = getMapBounds();

        // Chunk in top left
        if (coord.x == mapBounds.x && coord.y == mapBounds.w)
        {
            isCorner = true;
        }
        // Top right
        else if (coord.x == mapBounds.w && coord.y == mapBounds.y)
        {
            isCorner = true;
            corner   = FalloffGenerator.Corner.BOTTOMLEFT;
        }
        // Bottom left
        else if (coord.x == mapBounds.x && coord.y == mapBounds.z)
        {
            isCorner = true;
            corner   = FalloffGenerator.Corner.TOPRIGHT;
        }
        // Bottom right
        else if (coord.x == mapBounds.y && coord.y == mapBounds.z)
        {
            isCorner = true;
            corner   = FalloffGenerator.Corner.BOTTOMRIGHT;
        }
        // Left
        else if (coord.x == mapBounds.z)
        {
            isEdge = true;
        }
        // Bottom
        else if (coord.y == mapBounds.x)
        {
            isEdge = true;
            edge   = FalloffGenerator.Edge.RIGHT;
        }
        // Right
        else if (coord.x == mapBounds.w)
        {
            isEdge = true;
            edge   = FalloffGenerator.Edge.BOTTOM;
        }
        else if (coord.y == mapBounds.y)
        {
            isEdge = true;
            edge   = FalloffGenerator.Edge.LEFT;
        }

        return(new ChunkBorderInfo(isCorner, corner, isEdge, edge));
    }