2020-05-20 16:33:08 +08:00

50 lines
1.0 KiB
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():RoomEntity()
{
entity_type = ET_Loot;
++App::Instance()->perf.entity_num[ET_Loot];
}
Loot::~Loot()
{
--App::Instance()->perf.entity_num[ET_Loot];
}
void Loot::Initialize()
{
RoomEntity::Initialize();
RecalcSelfCollider();
}
void Loot::RecalcSelfCollider()
{
}
void Loot::FillMFObjectPart(Room* room, 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(GetPos(), p->mutable_pos());
}
void Loot::FillMFObjectFull(Room* room, 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(GetPos(), p->mutable_pos());
p->set_item_id(item_id);
p->set_count(count);
}