本文整理汇总了C++中ItemInst::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemInst::Clone方法的具体用法?C++ ItemInst::Clone怎么用?C++ ItemInst::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemInst
的用法示例。
在下文中一共展示了ItemInst::Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ItemInst
Object::Object(const char *model, float x, float y, float z, float heading, uint8 type, uint32 decay_time)
: respawn_timer(0), decay_timer(decay_time)
{
user = nullptr;
last_user = nullptr;
ItemInst* inst = nullptr;
inst = new ItemInst(ItemInstWorldContainer);
// Initialize members
m_id = 0;
m_inst = (inst) ? inst->Clone() : nullptr;
m_type = type;
m_icon = 0;
m_inuse = false;
m_ground_spawn = false;
// Set as much struct data as we can
memset(&m_data, 0, sizeof(Object_Struct));
m_data.heading = heading;
m_data.x = x;
m_data.y = y;
m_data.z = z;
m_data.zone_id = zone->GetZoneID();
if (decay_time)
decay_timer.Start();
respawn_timer.Disable();
if(model)
strcpy(m_data.object_name, model);
else
strcpy(m_data.object_name, "IT64_ACTORDEF"); //default object name if model isn't specified for some unknown reason
}
示例2: PutItem
void ItemInst::PutItem(uint8 index, const ItemInst& inst)
{
// Clean up item already in slot (if exists)
DeleteItem(index);
// Delegate to internal method
_PutItem(index, inst.Clone());
}
示例3: PushCursor
sint16 Inventory::PushCursor(const ItemInst& inst)
{
m_cursor.push(inst.Clone());
return SLOT_CURSOR;
}