mirror of
https://github.com/DrBeef/Raze.git
synced 2024-12-02 00:52:56 +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
|