# Inventory Layouts The `Inventory Layouts` is a handler for the game inventory. You can configure the layouts manually but the recommended way is to use {ref}`Inventory Form`. - - - ## TInventoryLayoutItem Type that represents a single inventory layout item. - - - ## TInventoryLayoutItem.ToJSON ```pascal function TInventoryLayoutItem.ToJSON(): TJSONItem; ``` Convert the `TInventoryLayoutItem` into a `TJSONItem`. - - - ## TInventoryLayoutSlots Type that represents an entire inventory layout. - - - ## TInventoryLayout.ToJSON ```pascal function TInventoryLayout.ToJSON(): TJSONItem; ``` Convert the `TInventoryLayout` into a `TJSONItem`. - - - ## TInventoryLayout Main type to user {ref}`Inventory Layouts`. - - - ## InventoryLayout.SetupBankItems ```pascal procedure TInventoryLayout.SetupBankItems(); ``` Internal function used to setup the `TInventoryLayout` {ref}`TBankItem`s. This is automatically called for you when it's needed. - - - ## InventoryLayout.IsValid ```pascal function TInventoryLayout.IsValid(): Boolean; ``` Returns true/false if whatever is inr you current {ref}`Inventory` is valid for your {ref}`TInventoryLayout`. Example: ```pascal WriteLn layout.IsValid(); ``` - - - ## InventoryLayout.DepositDiff ```pascal function TInventoryLayout.DepositDiff(): Boolean; ``` Assuming the {ref}`Bank` is open, this will deposit every item in your inventory that doesn't match your {ref}`TInventoryLayout`. Example: ```pascal if Bank.Open() then layout.DepositDiff(); ``` - - - ## InventoryLayout.Withdraw ```pascal function TInventoryLayout.Withdraw(): Boolean; ``` Assuming the {ref}`Bank` is open, this will withdraw anything necessay so your {ref}`Inventory` contents match your `TInventoryLayout`. Example: ```pascal if Bank.Open() then layout.Withdraw(); ``` - - - ## InventoryLayout.Reorder ```pascal function TInventoryLayout.Reorder(): Boolean; ``` Attempts to reorder the items in your {ref}`Inventory` to it matches your `TInventoryLayout`. Example: ```pascal layout.Reorder(); ```