扩展

池遍历 PoolIterator

对 CPool 做 range-for

PoolIterator.h

range-for 遍历池

CPool 提供 begin / end,自动跳过 free 槽。池尚未建立时不要遍历。

// CPool 引用或指针
for (CPed* ped : *CPools::ms_pPedPool) {}

找下一个占用槽

日常优先 range-for;需要手动扫槽时再用:

static int FindNextActiveSlotInPool(CPool<T1, T2>* pool, int currentSlot);

On this page