mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-13 14:10:54 +00:00
51 lines
738 B
C
51 lines
738 B
C
|
#pragma once
|
||
|
#include "dobject.h"
|
||
|
#include "build.h"
|
||
|
|
||
|
BEGIN_DUKE_NS
|
||
|
|
||
|
|
||
|
// Iterator wrappers that return an actor pointer, not an index.
|
||
|
class DukeStatIterator : public StatIterator
|
||
|
{
|
||
|
public:
|
||
|
DukeStatIterator(int stat) : StatIterator(stat)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
DDukeActor *Next()
|
||
|
{
|
||
|
int n = NextIndex();
|
||
|
return n >= 0? &hittype[n] : nullptr;
|
||
|
}
|
||
|
|
||
|
DDukeActor *Peek()
|
||
|
{
|
||
|
int n = PeekIndex();
|
||
|
return n >= 0? &hittype[n] : nullptr;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class DukeSectIterator : public SectIterator
|
||
|
{
|
||
|
public:
|
||
|
DukeSectIterator(int stat) : SectIterator(stat)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
DDukeActor *Next()
|
||
|
{
|
||
|
int n = NextIndex();
|
||
|
return n >= 0? &hittype[n] : nullptr;
|
||
|
}
|
||
|
|
||
|
DDukeActor *Peek()
|
||
|
{
|
||
|
int n = PeekIndex();
|
||
|
return n >= 0? &hittype[n] : nullptr;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
END_DUKE_NS
|