gzdoom-gles/src/g_shared/a_specialspot.h
Christoph Oelckers 7b7623d2c4 - split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first.
Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
2017-01-12 22:49:18 +01:00

45 lines
928 B
C++

#ifndef __A_SPECSPOT_H
#define __A_SPECSPOT_H
#include "actor.h"
#include "tarray.h"
class ASpecialSpot : public AActor
{
DECLARE_CLASS (ASpecialSpot, AActor)
public:
void BeginPlay();
void OnDestroy() override;
};
struct FSpotList;
class DSpotState : public DThinker
{
DECLARE_CLASS(DSpotState, DThinker)
static TObjPtr<DSpotState> SpotState;
TArray<FSpotList> SpotLists;
public:
DSpotState ();
void OnDestroy() override;
void Tick ();
static DSpotState *GetSpotState(bool create = true);
FSpotList *FindSpotList(PClassActor *type);
bool AddSpot(ASpecialSpot *spot);
bool RemoveSpot(ASpecialSpot *spot);
void Serialize(FSerializer &arc);
ASpecialSpot *GetNextInList(PClassActor *type, int skipcounter);
ASpecialSpot *GetSpotWithMinMaxDistance(PClassActor *type, double x, double y, double mindist, double maxdist);
ASpecialSpot *GetRandomSpot(PClassActor *type, bool onlyonce = false);
};
#endif