Need Help About CalculateTakeBack Method

First of all I see and read all of these in this topicGazoon007’s question..

Item can be stackable or not but in this architecture it looks like ItemSlot is stackable or not. MaxAcceptable is inside of IDragDestination and DragDestination is on ItemSlot. But inside of MaxAcceptable we are asking item about its acceptablelimit. So end of the day Item gives information about own limits.

X = Health Potion ( Limit : 100, CurrentStack : 75 ) its on item slot 5.
Y = Health Potion ( Limit : 100, CurrentStack : 23 ) its on item slot 9.
Z = Mana Potion ( Limit : 100, CurrentStack : 85 ) its on item slot 12.

When I want to swap x-y, it triggers SimpleSwap. We are good.

When I want to swap x-z or y-z, it triggers AttemptSwap. My problem is here;

  • We know both item’s are different,
  1. Question : Why do we check HealthPotion.MaxAcceptable < RemovedNumber. Because it is not possible and if its possible is this place alright to check ?
  2. Question : When we have take backs, we are adding that count to source or destination. And we swap items with take backed count. This items are different why do we do that ?

Thanks for your time. :grinning_face_with_smiling_eyes:

Can you make a video demonstrating what is happening?

Privacy & Terms