This commit is contained in:
aozhiwei 2024-03-29 17:57:18 +08:00
parent e0bc44f63b
commit 992dd27cef
3 changed files with 25 additions and 30 deletions

View File

@ -46,27 +46,6 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
InGameVoiceEventType_e::kGlobalKills, InGameVoiceEventType_e::kGlobalKills,
[this] (const mt::InGameVoice* meta) -> bool [this] (const mt::InGameVoice* meta) -> bool
{ {
switch (meta->CondType()) {
case InGameVoiceCondType_e::kEQ:
{
}
break;
case InGameVoiceCondType_e::kGT:
{
}
break;
case InGameVoiceCondType_e::kGE:
{
}
break;
default:
{
}
break;
}
return true; return true;
}); });
} }

View File

@ -129,14 +129,31 @@ namespace mt
} }
} }
InGameVoiceCondType_e InGameVoice::CondType() const bool InGameVoice::MatchCond(int val) const
{ {
return _cond_type; switch (_cond_type) {
case InGameVoiceCondType_e::kEQ:
{
return _cond_val == val;
} }
break;
int InGameVoice::CondVal() const case InGameVoiceCondType_e::kGT:
{ {
return _cond_val; return _cond_val > val;
}
break;
case InGameVoiceCondType_e::kGE:
{
return _cond_val >= val;
}
break;
default:
{
return false;
}
break;
}
return false;
} }
} }

View File

@ -50,8 +50,7 @@ namespace mt
void Init1(); void Init1();
void Init2(); void Init2();
InGameVoiceNotifyObject_e GetNotifyObject() const; InGameVoiceNotifyObject_e GetNotifyObject() const;
InGameVoiceCondType_e CondType() const; bool MatchCond(int val) const;
int CondVal() const;
static void Traverse(bool is_moba_room, int event_type, std::function<bool (const InGameVoice*)> cb); static void Traverse(bool is_moba_room, int event_type, std::function<bool (const InGameVoice*)> cb);