Files
2026-03-04 09:37:33 +08:00

67 lines
1.4 KiB
C#

namespace DebuggingEssentials
{
public class CullGroup
{
private static FastList<CullList> cullLists = new FastList<CullList>();
public CullList cullList;
private double startHeight;
public static void ResetStatic()
{
cullLists.Clear();
}
public CullGroup(int capacity)
{
cullList = new CullList(capacity);
}
public void CalcDraw(bool reset, FastList<CullList> _cullLists)
{
if (reset)
{
startHeight = 0.0;
this.cullList.cullItems.Clear();
}
cullLists.Clear();
for (int i = 0; i < _cullLists.Count; i++)
{
CullList cullList = _cullLists.items[i];
if (reset)
{
cullList.currentCalcCullItem = 0;
}
if (cullList.currentCalcCullItem < cullList.cullItems.Count)
{
cullLists.Add(cullList);
}
}
while (cullLists.Count > 0)
{
int num = int.MaxValue;
int num2 = -1;
for (int j = 0; j < cullLists.Count; j++)
{
CullList cullList2 = cullLists.items[j];
int id = cullList2.cullItems.items[cullList2.currentCalcCullItem].id;
if (id < num)
{
num = id;
num2 = j;
}
}
if (!cullLists.items[num2].Draw(this.cullList, ref startHeight))
{
cullLists.RemoveAt(num2);
}
}
if (reset && this.cullList.cullItems.Count > 0 && this.cullList.cullItems.items[this.cullList.cullItems.Count - 1].isHeader)
{
this.cullList.cullItems.RemoveLast();
}
}
}
}