5 class SCR_ContainerBudgetManager<Class CONTAINER_TYPE, Class ITEM_TYPE>
7 protected CONTAINER_TYPE m_Container;
8 protected int m_iBudgetSize;
9 protected int m_iPivot;
26 void SetContainer(CONTAINER_TYPE container)
28 m_Container = container;
38 array<ITEM_TYPE> ProcessNextBatch()
44 int containerCount = m_Container.Count();
45 array<ITEM_TYPE> batch = {};
47 batch.Reserve(m_iBudgetSize);
49 if (containerCount == 0)
52 for (
int i = 0; (i < m_iBudgetSize && batch.Count() < m_iBudgetSize); ++i)
54 if (m_iPivot >= containerCount)
57 item = m_Container[m_iPivot++];
66 void SCR_ContainerBudgetManager(CONTAINER_TYPE container,
int budgetSize)
68 m_Container = container;
69 m_iBudgetSize = budgetSize;