public void DeleteOutfit(VM vm, uint outfitPID, VMGLOutfitOwner owner, uint ownerPID, VMAsyncDeleteOutfitCallback callback) { Host.InBackground(() => { using (var db = DAFactory.Get()) { if (owner == VMGLOutfitOwner.OBJECT) { callback(db.Outfits.DeleteFromObject(outfitPID, ownerPID)); } else if (owner == VMGLOutfitOwner.AVATAR) { callback(db.Outfits.DeleteFromAvatar(outfitPID, ownerPID)); } } }); }
public void GetOutfits(VM vm, VMGLOutfitOwner owner, uint ownerPID, VMAsyncGetOutfitsCallback callback) { Host.InBackground(() => { using (var db = DAFactory.Get) { var outfits = owner == VMGLOutfitOwner.OBJECT ? db.Outfits.GetByObjectId(ownerPID) : db.Outfits.GetByAvatarId(ownerPID); callback( outfits.Select(x => { var outfit = new VMGLOutfit() { asset_id = x.asset_id, outfit_id = x.outfit_id, sale_price = x.sale_price, purchase_price = x.purchase_price, outfit_type = x.outfit_type, outfit_source = x.outfit_source == Database.DA.Outfits.DbOutfitSource.cas ? VMGLOutfitSource.cas : VMGLOutfitSource.rack }; if (x.avatar_owner != null && x.avatar_owner.HasValue) { outfit.owner_type = VMGLOutfitOwner.AVATAR; outfit.owner_id = x.avatar_owner.Value; } else if (x.object_owner != null && x.object_owner.HasValue) { outfit.owner_type = VMGLOutfitOwner.OBJECT; outfit.owner_id = x.object_owner.Value; } return(outfit); }).ToArray() ); } }); }
public void DeleteOutfit(VM vm, uint outfitPID, VMGLOutfitOwner owner, uint ownerPID, VMAsyncDeleteOutfitCallback callback) { }
public void GetOutfits(VM vm, VMGLOutfitOwner owner, uint ownerPID, VMAsyncGetOutfitsCallback callback) { callback(new VMGLOutfit[0]); }