示例#1
0
    static bool UpdateFullLoopLeft(IcoSegment segment, int side)
    {
        IcoSegment current  = segment.neighbours[side];
        IcoSegment previous = segment;

        while (current != segment)
        {
            current.UpdateSegment();
            IcoSegment tmp = current;
            current  = current.LeftFrom(previous);
            previous = tmp;
        }
        return(true);
    }
示例#2
0
    public static int MaxHeightAtCorner(IcoSegment segment, int corner)
    {
        int        max      = int.MinValue;
        IcoSegment current  = segment.neighbours[corner];
        IcoSegment previous = segment;

        while (current != segment)
        {
            max = Mathf.Max(max, current.heightLevel);
            IcoSegment tmp = current;
            current  = current.LeftFrom(previous);
            previous = tmp;
        }
        return(max);
    }
示例#3
0
    public static bool LoopLeftBelowLevel(IcoSegment segment, int side, int level)
    {
        IcoSegment current  = segment.neighbours[side];
        IcoSegment previous = segment;

        while (current != segment)
        {
            if (current.heightLevel < level)
            {
                return(false);
            }
            IcoSegment tmp = current;
            current  = current.LeftFrom(previous);
            previous = tmp;
        }
        return(true);
    }