Ejemplo n.º 1
0
 /// <summary>
 /// Handles a request to move an item from stash the inventory and back
 /// </summary>
 public void HandleInventoryRequestQuickMoveMessage(InventoryRequestQuickMoveMessage request)
 {
     /*Item item = GetItem(request.ItemID);
      * if (item == null || (request.DestEquipmentSlot != (int)EquipmentSlotId.Stash && request.DestEquipmentSlot != (int)EquipmentSlotId.Inventory))
      *  return;
      * // Identify source and destination grids
      * var destinationGrid = request.DestEquipmentSlot == 0 ? _inventoryGrid : _stashGrid;
      * var sourceGrid = request.DestEquipmentSlot == 0 ? _stashGrid : _inventoryGrid;
      *
      * if (destinationGrid.HasFreeSpace(request.DestRowStart, request.DestRowEnd, item))
      * {
      *  sourceGrid.RemoveItem(item);
      *  destinationGrid._addItemAtPosition(request.DestRowStart, request.DestRowEnd, item);
      * }*/
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles a request to move an item from stash the inventory and back
        /// </summary>
        public void HandleInventoryRequestQuickMoveMessage(InventoryRequestQuickMoveMessage request)
        {
            Item item = GetItem(request.ItemID);

            if (item == null || (request.DestEquipmentSlot != (int)EquipmentSlotId.Stash && request.DestEquipmentSlot != (int)EquipmentSlotId.Inventory))
            {
                return;
            }
            // Identify source and destination grids
            var destinationGrid = request.DestEquipmentSlot == 0 ? _inventoryGrid : _stashGrid;
            var sourceGrid      = request.DestEquipmentSlot == 0 ? _stashGrid : _inventoryGrid;

            if (destinationGrid.HasFreeSpace(request.DestRowStart, request.DestRowEnd, item))
            {
                sourceGrid.RemoveItem(item);
                destinationGrid.AddItem(request.DestRowStart, request.DestRowEnd, item);
            }
        }