61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
namespace cs
|
|
{
|
|
class SMRollMsg;
|
|
}
|
|
|
|
struct KillInfo
|
|
{
|
|
int root_master_id = 0;
|
|
int killer_id = 0;
|
|
std::string killer_name;
|
|
int weapon_id = 0;
|
|
int real_killer_id = 0;
|
|
std::string real_killer_name;
|
|
};
|
|
|
|
struct RollMsgHintInfo
|
|
{
|
|
std::string master_name;
|
|
std::string killer_name;
|
|
std::string dead_name;
|
|
std::string weapon_text_icon;
|
|
|
|
std::vector<std::tuple<int, std::string>>* hint_template = nullptr;
|
|
bool Replace(int idx, std::string& text);
|
|
};
|
|
|
|
class Human;
|
|
class KillMgr : public a8::Singleton<KillMgr>
|
|
{
|
|
|
|
private:
|
|
KillMgr() {};
|
|
friend class a8::Singleton<KillMgr>;
|
|
|
|
public:
|
|
|
|
void Init();
|
|
void UnInit();
|
|
void OnHumanDead(Human* dead_hum, KillInfo* info);
|
|
|
|
private:
|
|
void FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info);
|
|
void PreprocessRollMsg(std::shared_ptr<cs::SMRollMsg> pb_msg,
|
|
RollMsgHintInfo& hint_info);
|
|
void BoradcastRollMsg(Human* dead_hum,
|
|
KillInfo* info,
|
|
int killer_team_id,
|
|
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
|
void BoradcastRollMsgCb(Human* dead_hum,
|
|
KillInfo* info,
|
|
int killer_team_id,
|
|
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
|
|
|
|
|
friend class PBUtils;
|
|
};
|