- another iterator.

This one's for init code that needs to iterate sprites in spawn order.
This commit is contained in:
Christoph Oelckers 2020-10-27 07:15:03 +01:00
parent 12ef8c4543
commit 32fc9329de

View file

@ -68,6 +68,22 @@ public:
}
};
class DukeLinearSpriteIterator
{
int index = 0;
public:
DDukeActor* Next()
{
while (index < MAXSPRITES)
{
auto p = &hittype[index++];
if (p->s.statnum != MAXSTATUS) return p;
}
return nullptr;
}
};
inline DDukeActor* player_struct::GetActor()
{
return &hittype[i];