2019-07-13 14:38:26 +08:00

85 lines
2.0 KiB
C++

#pragma once
#include "human.h"
namespace cs
{
class CMMove;
class CMDropItem;
class CMEmote;
class CMVoice;
class MFActivePlayerData;
class MFGasData;
}
class Room;
class Loot;
class Obstacle;
class Player : public Human
{
public:
enum { HID = HID_Player };
public:
int team_mode = 0;
bool auto_fill = false;
bool use_touch = false;
long long create_tick = 0;
int last_seq_id = 0;
bool moving = false;
int moved_frames = 0;
bool select_weapon = false;
size_t selected_weapon_idx = 0;
bool drop_weapon = false;
size_t drop_weapon_idx = 0;
bool cancel_action = false;
bool use_item = false;
int use_item_idx = 0;
bool use_scope = false;
int use_scope_idx = 0;
bool reload = false;
bool spectate = false;
bool emote = false;
int emote_id = 0;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > interaction_objids;
Player();
virtual ~Player() override;
virtual void Initialize() override;
virtual void Update(int delta_time) override;
void UpdateMove();
void UpdateShot();
void UpdateSelectWeapon();
void UpdateDropWeapon();
void UpdateUseScope();
void UpdateReload();
void UpdateCancelAction();
void UpdateUseItemIdx();
void UpdateSpectate();
void UpdateEmote();
void UpdateUseSkill();
void ProcInteraction();
void ObstacleInteraction(Obstacle* entity);
void LootInteraction(Loot* entity);
void HumanInteraction(Human* hum);
void ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& prepare_items);
void _CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg);
void _CMEmote(f8::MsgHdr& hdr, const cs::CMEmote& msg);
void _CMVoice(f8::MsgHdr& hdr, const cs::CMVoice& msg);
void _CMGameOver(f8::MsgHdr& hdr, const cs::CMGameOver& msg);
void _CMWatchWar(f8::MsgHdr& hdr, const cs::CMWatchWar& msg);
void _CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg);
};