mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-12 15:44:10 +00:00
5cc1b4991c
- added an abstract base class for special map spots that are maintained in lists and rewrote the boss brain, the mace and DSparil to use it. - fixed: RandomSpawners didn't destroy themselves after finishing their work. SVN r1076 (trunk)
45 lines
No EOL
948 B
C++
45 lines
No EOL
948 B
C++
#ifndef __A_SPECSPOT_H
|
|
#define __A_SPECSPOT_H
|
|
|
|
#include "actor.h"
|
|
#include "tarray.h"
|
|
|
|
class ASpecialSpot : public AActor
|
|
{
|
|
DECLARE_STATELESS_ACTOR (ASpecialSpot, AActor)
|
|
|
|
public:
|
|
|
|
void BeginPlay();
|
|
void Destroy();
|
|
};
|
|
|
|
|
|
struct FSpotList;
|
|
|
|
|
|
class DSpotState : public DThinker
|
|
{
|
|
DECLARE_CLASS(DSpotState, DThinker)
|
|
static TObjPtr<DSpotState> SpotState;
|
|
TArray<FSpotList *> SpotLists;
|
|
|
|
public:
|
|
|
|
|
|
DSpotState ();
|
|
void Destroy ();
|
|
void Tick ();
|
|
static DSpotState *GetSpotState(bool create = true);
|
|
FSpotList *FindSpotList(const PClass *type);
|
|
bool AddSpot(ASpecialSpot *spot);
|
|
bool RemoveSpot(ASpecialSpot *spot);
|
|
void Serialize(FArchive &arc);
|
|
ASpecialSpot *GetNextInList(const PClass *type, int skipcounter);
|
|
ASpecialSpot *GetSpotWithMinDistance(const PClass *type, fixed_t x, fixed_t y, fixed_t distance);
|
|
ASpecialSpot *GetRandomSpot(const PClass *type, bool onlyonce = false);
|
|
};
|
|
|
|
|
|
|
|
#endif |