2023-10-02 00:28:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-10-02 04:26:45 +00:00
|
|
|
#include "d_net.h"
|
2023-10-02 00:28:09 +00:00
|
|
|
#include "packet.h"
|
|
|
|
#include "gameinput.h"
|
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
class DCorePlayer : public DObject
|
2023-10-02 00:28:09 +00:00
|
|
|
{
|
2023-10-02 19:03:59 +00:00
|
|
|
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:
|
2023-10-02 05:05:16 +00:00
|
|
|
ticcmd_t lastcmd, cmd;
|
2023-10-02 00:28:09 +00:00
|
|
|
PlayerAngles Angles;
|
2023-10-02 02:27:16 +00:00
|
|
|
DCoreActor* actor;
|
2023-10-02 07:44:04 +00:00
|
|
|
uint8_t pnum;
|
2023-10-02 02:27:16 +00:00
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
DCorePlayer(uint8_t p) : pnum(p) {}
|
|
|
|
void OnDestroy() override { if (actor) actor->Destroy(); actor = nullptr; }
|
2023-10-02 02:27:16 +00:00
|
|
|
virtual DCoreActor* GetActor() = 0;
|
2023-10-02 19:38:58 +00:00
|
|
|
void Serialize(FSerializer& arc) override;
|
2023-10-02 00:28:09 +00:00
|
|
|
};
|
2023-10-02 04:26:45 +00:00
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
extern DCorePlayer* PlayerArray[MAXPLAYERS];
|