raze/source/games/duke/src/dukeactor.h

51 lines
738 B
C
Raw Normal View History

2020-10-17 07:14:31 +00:00
#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