raze/source/games/sw/src/swactor.h

59 lines
970 B
C
Raw Normal View History

#pragma once
// included by game.h
BEGIN_SW_NS
class DSWActor : public DCoreActor
{
DECLARE_CLASS(DSWActor, DCoreActor)
HAS_OBJECT_POINTERS
public:
2021-11-19 23:18:23 +00:00
bool hasUser;
USER user;
2021-11-24 19:11:50 +00:00
walltype* tempwall; // transient, to replace a hack using a 16 bit sprite field.
DSWActor* ownerActor;
2021-11-19 23:18:23 +00:00
DSWActor() = default;
DSWActor& operator=(const DSWActor& other) = default;
void ClearContent()
{
Super::ClearContent();
clearUser();
tempwall = nullptr;
}
2021-11-19 23:18:23 +00:00
bool hasU() { return hasUser; }
2021-11-19 23:18:23 +00:00
USER* u() { return &user; }
USER* allocUser()
{
2021-11-19 23:18:23 +00:00
hasUser = true;
return u();
}
2021-11-01 22:26:13 +00:00
void clearUser()
{
2021-11-19 23:18:23 +00:00
hasUser = false;
user.Clear();
2021-11-01 22:26:13 +00:00
}
void Serialize(FSerializer& arc) override;
};
// subclassed to add a game specific actor() method
// Iterator wrappers that return an actor pointer, not an index.
using SWStatIterator = TStatIterator<DSWActor>;
using SWSectIterator = TSectIterator<DSWActor>;
using SWSpriteIterator = TSpriteIterator<DSWActor>;
END_SW_NS