2019-06-29 10:17:46 +08:00

50 lines
996 B
C++

#include "precompile.h"
#include "loot.h"
#include "metamgr.h"
#include "room.h"
#include "collider.h"
#include "entity.h"
#include "app.h"
#include "typeconvert.h"
Loot::Loot():Entity()
{
entity_type = ET_Loot;
++App::Instance()->perf.entity_num[ET_Loot];
}
Loot::~Loot()
{
--App::Instance()->perf.entity_num[ET_Loot];
}
void Loot::Initialize()
{
Entity::Initialize();
RecalcSelfCollider();
}
void Loot::RecalcSelfCollider()
{
}
void Loot::FillMFObjectPart(cs::MFObjectPart* part_data)
{
part_data->set_object_type(ET_Loot);
cs::MFLootPart* p = part_data->mutable_union_obj_5();
p->set_obj_uniid(entity_uniid);
TypeConvert::ToPb(pos, p->mutable_pos());
}
void Loot::FillMFObjectFull(cs::MFObjectFull* full_data)
{
full_data->set_object_type(ET_Loot);
cs::MFLootFull* p = full_data->mutable_union_obj_5();
p->set_obj_uniid(entity_uniid);
TypeConvert::ToPb(pos, p->mutable_pos());
p->set_item_id(item_id);
p->set_count(count);
}