public bool MapDropedItemGuid2UInt32(Role.DropedItem.DropedItemRole role) { if (role.SingleId != 0) { return(false); } Role.DropedItem.DropedItemRole temp; if (mTableDropedItems.TryGetValue(role.Id, out temp)) { return(false); } UInt32 singleId = 0; for (int count = 0; count < (UInt32)EIdIndexInfo.MaxDropedItemInPlanes; count++) { if (mSingeIdDropedItems.TryGetValue(mNextDropedItemId, out temp) == false) { singleId = mNextDropedItemId; mNextDropedItemId++; break; } else { ++mNextDropedItemId; if (mNextDropedItemId >= (UInt32)EIdIndexInfo.SummonEnd) { mNextDropedItemId = (UInt32)EIdIndexInfo.SummonStart; } } } if (singleId == 0) { return(false); } role._SetSingleId(singleId); mTableDropedItems.Add(role.Id, role); mSingeIdDropedItems.Add(singleId, role); return(true); }
public void UnmapDropedItemGuid2UInt32(Role.DropedItem.DropedItemRole role) { mTableDropedItems.Remove(role.Id); mSingeIdDropedItems.Remove(role.SingleId); role._SetSingleId(0); }