public override void DoAction(ItemDataComponent itemObject) { ItemData itemData = itemObject.GetComponent <ItemDataComponent>().itemData; string itemStacks = ConvertContainerItemToSerializedJsonObject(itemData); CloudGoods.MoveItemStacks(itemStacks, CloudGoods.user.userID.ToString(), "Session", 0, OnItemMoved(itemData)); }
public override void DoAction(ItemDataComponent itemObject) { ItemData itemData = itemObject.GetComponent <ItemDataComponent>().itemData; ///Tmp moves all to vault on backend MoveMultipleStacks stacks = new MoveMultipleStacks(); stacks.StackInfos = new List <MoveItemStackInfo>(); foreach (ItemData item in SourceContainer.containerItems) { MoveItemStackInfo info = new MoveItemStackInfo(); info.MoveAmount = item.stackSize; info.StackID = item.stackID; stacks.StackInfos.Add(info); } string convert = JsonConvert.SerializeObject(stacks); CloudGoods.MoveItemStacks(convert, CloudGoods.user.userID.ToString(), "User", DestinationLocation, delegate(MoveMultipleItemsResponse x) { ItemData[] containerItems = new ItemData[SourceContainer.containerItems.Count]; SourceContainer.containerItems.CopyTo(containerItems); foreach (MovedItemsInfo info in x.movedItems) { foreach (ItemData data in containerItems) { if (data.stackID == info.OriginalStackID) { data.stackID = info.NewStackID; SourceContainer.Remove(data, true); DestinationContainer.Add(data, -1, false); } } } }); }
public override void DoAction(ItemDataComponent itemObject) { ItemData itemData = itemObject.GetComponent <ItemDataComponent>().itemData; ItemContainerManager.MoveItem(itemData, itemData.ownerContainer, MoveToContainer); }
public override void DoAction(ItemDataComponent itemObject) { ItemData itemData = itemObject.GetComponent <ItemDataComponent>().itemData; itemData.ownerContainer.Remove(itemData, false, itemData.stackSize); }