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); }
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); }
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); }