Esempio n. 1
0
    void merge(C2DHoledPolyArc stoneShape, List <C2DHoledPolyArc> shapesToMerge, List <C2DHoledPolyArc> ownShape)
    {
        List <C2DHoledPolyArc> acc = new List <C2DHoledPolyArc>();
        CGrid grid = new CGrid();

        grid.SetGridSize(0.01f);

        if (shapesToMerge.Count == 0)
        {
            ownShape.Add(stoneShape);
            return;
        }

        foreach (C2DHoledPolyArc shape in shapesToMerge)
        {
            ownShape.Remove(shape);
        }

        foreach (C2DHoledPolyArc shape in shapesToMerge)
        {
            shape.GetUnion(stoneShape, acc, grid);
        }

        ownShape.Add(acc[acc.Count - 1]);
    }