1
This commit is contained in:
parent
37135c3173
commit
0f4712b43f
@ -818,6 +818,8 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
|||||||
p->add_values(pair.second);
|
p->add_values(pair.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stats.CalcReward(this, stats.rank, stats.kills);
|
||||||
|
TypeConvert::ToPb(stats.over_reward, msg.mutable_reward());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
|
#include "typeconvert.h"
|
||||||
#include "cs_proto.pb.h"
|
#include "cs_proto.pb.h"
|
||||||
|
#include "human.h"
|
||||||
|
|
||||||
namespace TypeConvert
|
namespace TypeConvert
|
||||||
{
|
{
|
||||||
@ -16,4 +18,18 @@ namespace TypeConvert
|
|||||||
v.y = pb_obj->y();
|
v.y = pb_obj->y();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToPb(const OverReward& v, cs::MFOverReward* pb_obj)
|
||||||
|
{
|
||||||
|
pb_obj->set_total(v.total);
|
||||||
|
pb_obj->mutable_hero()->set_obtain_gold(v.hero.obtain_gold);
|
||||||
|
pb_obj->mutable_hero()->set_gold_limit(v.hero.gold_limit);
|
||||||
|
|
||||||
|
pb_obj->mutable_weapon1()->set_obtain_gold(v.weapon1.obtain_gold);
|
||||||
|
pb_obj->mutable_weapon1()->set_gold_limit(v.weapon1.gold_limit);
|
||||||
|
|
||||||
|
pb_obj->mutable_weapon2()->set_obtain_gold(v.weapon2.obtain_gold);
|
||||||
|
pb_obj->mutable_weapon2()->set_gold_limit(v.weapon2.gold_limit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,15 @@
|
|||||||
namespace cs
|
namespace cs
|
||||||
{
|
{
|
||||||
class MFVec2;
|
class MFVec2;
|
||||||
|
class MFOverReward;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct OverReward;
|
||||||
|
|
||||||
namespace TypeConvert
|
namespace TypeConvert
|
||||||
{
|
{
|
||||||
void ToPb(const a8::Vec2& v, cs::MFVec2* pb_obj);
|
void ToPb(const a8::Vec2& v, cs::MFVec2* pb_obj);
|
||||||
void FromPb(a8::Vec2& v, const cs::MFVec2* pb_obj);
|
void FromPb(a8::Vec2& v, const cs::MFVec2* pb_obj);
|
||||||
|
|
||||||
|
void ToPb(const OverReward& v, cs::MFOverReward* pb_obj);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user