raze/source/core/coreplayer.h

35 lines
705 B
C
Raw Normal View History

#pragma once
#include "d_net.h"
#include "packet.h"
#include "gameinput.h"
class DCorePlayer : public DObject
{
DECLARE_CLASS(DCorePlayer, DObject)
HAS_OBJECT_POINTERS
protected:
DCorePlayer() = default;
void Clear()
{
memset(&lastcmd, 0, sizeof(lastcmd));
memset(&cmd, 0, sizeof(cmd));
memset(&Angles, 0, sizeof(Angles));
actor = nullptr;
pnum = 0;
}
public:
ticcmd_t lastcmd, cmd;
PlayerAngles Angles;
DCoreActor* actor;
uint8_t pnum;
DCorePlayer(uint8_t p) : pnum(p) {}
void OnDestroy() override { if (actor) actor->Destroy(); actor = nullptr; }
virtual DCoreActor* GetActor() = 0;
2023-10-02 19:38:58 +00:00
void Serialize(FSerializer& arc) override;
};
extern DCorePlayer* PlayerArray[MAXPLAYERS];