void RecieveShopItem(IDroppableData dropItem) { if (_model.Item == null) { App.Instance.FarmModel.ShopInventory.Items[dropItem.Data.Id].Spend(); if (OnFarmItemRecieved != null) { ShopItem shopItem = dropItem.Data as ShopItem; OnFarmItemRecieved.Invoke(shopItem.FarmItemId); } } OnRecieved(); }
void RecieveProduct(IDroppableData dropItem) { if (_model.Item == null) { return; } if (OnProductRecieved != null) { OnProductRecieved.Invoke(dropItem.Data as Product); } OnRecieved(); }
public void OnDroppedObject(IDroppableData dropItem) { if (dropItem == null || dropItem.Data == null) { return; } if (dropItem.Data.Type == UserRepository.SHOP) { RecieveShopItem(dropItem); } else if (dropItem.Data.Type == UserRepository.PRODUCTS) { RecieveProduct(dropItem); } }