Skip to content

Detailed Explanation of UIS Principles

principle

All items are stored in DBItems. The DBItems structure contains some commonly used attributes (modifiable), while the original attributes are stored in DT_Inventory (immutable) and are linked via Name and Row.

Since DBItems is in array form, unused data is not removed but stored in the SurplusItemIndex (array) variable. When inserting new items, the indices in SurplusItemIndex are used first.

AllDBKey (array) stores SlotType+SlotIndex+DBIndex to facilitate item interaction locations. However, since it is an array, when only SlotType+SlotIndex is known, the array needs to be traversed to query, which is inefficient. To improve performance, mappings are established using SlotToDBMap and DBToSlotMap, allowing direct key queries.