It does not guarantee the cells are distributed in any configuration conductive to item stowing.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>the number of free cells</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#CheckCollisions"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="CheckCollisions(start:Int,w:Int,h:Int):scala.util.Try[List[Int]]"></a><aid="CheckCollisions(Int,Int,Int):Try[List[Int]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#CheckCollisions(start:Int,w:Int,h:Int):scala.util.Try[List[Int]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">CheckCollisions</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<spanname="scala.Int"class="extype">Int</span>]]</span></span><pclass="shortcomment cmt">Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.</p><divclass="fullcomment"><divclass="comment cmt"><p>Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the cell index to test this <code>Equipment</code> for insertion</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the <code>Equipment</code> to be tested</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the <code>Equipment</code> to be tested</p></dd><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of GUID values for all existing contents that this item would overlap if inserted</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#CheckCollisions"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="CheckCollisions(start:Int,item:net.psforever.objects.equipment.Equipment):scala.util.Try[List[Int]]"></a><aid="CheckCollisions(Int,Equipment):Try[List[Int]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#CheckCollisions(start:Int,item:net.psforever.objects.equipment.Equipment):scala.util.Try[List[Int]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">CheckCollisions</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="item">item: <ahref="../equipment/Equipment.html"name="net.psforever.objects.equipment.Equipment"id="net.psforever.objects.equipment.Equipment"class="extype">Equipment</a></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<spanname="scala.Int"class="extype">Int</span>]]</span></span><pclass="shortcomment cmt">Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
A "collision" is considered a situation where the stowed placards of two items would overlap in some way.</p><divclass="fullcomment"><divclass="comment cmt"><p>Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
A "collision" is considered a situation where the stowed placards of two items would overlap in some way.
The grid keeps track of the location of items by storing the primitive of their GUID in one or more cells.
Two primitives can not be stored in the same cell.
If placing two items into the same inventory leads to a situation where two primitive values might be in the same cell,
that is a collision.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the cell index to test this <code>Equipment</code> for insertion</p></dd><dtclass="param">item</dt><ddclass="cmt"><p>the <code>Equipment</code> to be tested</p></dd><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of GUID values for all existing contents that this item would overlap if inserted</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#CheckCollisionsAsGrid"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="CheckCollisionsAsGrid(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"></a><aid="CheckCollisionsAsGrid(Int,Int,Int):Try[List[InventoryItem]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#CheckCollisionsAsGrid(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">CheckCollisionsAsGrid</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]]</span></span><pclass="shortcomment cmt">Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
Iterate over all cells that would be occupied by a new value and check each one whether or not that cell has an existing value.</p><divclass="fullcomment"><divclass="comment cmt"><p>Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
Iterate over all cells that would be occupied by a new value and check each one whether or not that cell has an existing value.
This is a "using the inventory as a grid" method.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the cell index to test this <code>Equipment</code> for insertion</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the <code>Equipment</code> to be tested</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the <code>Equipment</code> to be tested</p></dd><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of existing items that an item of this scale would overlap if inserted</p></dd></dl><dlclass="attributes block"><dt>Exceptions thrown</dt><dd><spanclass="cmt"><p><spanname="IndexOutOfBoundsException"class="extype"><code>IndexOutOfBoundsException</code></span> if the region extends outside of the grid boundaries</p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#CheckCollisionsAsList"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="CheckCollisionsAsList(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"></a><aid="CheckCollisionsAsList(Int,Int,Int):Try[List[InventoryItem]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#CheckCollisionsAsList(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">CheckCollisionsAsList</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]]</span></span><pclass="shortcomment cmt">Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
Iterate over all stowed items and check each one whether or not it overlaps with the given region.</p><divclass="fullcomment"><divclass="comment cmt"><p>Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
Iterate over all stowed items and check each one whether or not it overlaps with the given region.
This is a "using the inventory as a <code>List</code>" method.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the cell index to test this <code>Equipment</code> for insertion</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the <code>Equipment</code> to be tested</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the <code>Equipment</code> to be tested</p></dd><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of existing items that an item of this scale would overlap if inserted</p></dd></dl><dlclass="attributes block"><dt>Exceptions thrown</dt><dd><spanclass="cmt"><p><spanname="IndexOutOfBoundsException"class="extype"><code>IndexOutOfBoundsException</code></span> if the region extends outside of the grid boundaries</p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#CheckCollisionsVar"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="CheckCollisionsVar(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"></a><aid="CheckCollisionsVar(Int,Int,Int):Try[List[InventoryItem]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#CheckCollisionsVar(start:Int,w:Int,h:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">CheckCollisionsVar</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]]</span></span><pclass="shortcomment cmt">Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
If there are fewer items stored in the inventory than there are cells required to represent the testing item,
test the collision by iterating through the list of items.</p><divclass="fullcomment"><divclass="comment cmt"><p>Test whether a given piece of <code>Equipment</code> would collide with any stowed content in the inventory.<br>
<br>
If there are fewer items stored in the inventory than there are cells required to represent the testing item,
test the collision by iterating through the list of items.
If there are more items, check that each cell that would be used for the testing items tile does not collide.
The "testing item" in this case has already been transformed into its tile dimensions.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the cell index to test this <code>Equipment</code> for insertion</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the <code>Equipment</code> to be tested</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the <code>Equipment</code> to be tested</p></dd><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of existing items that an item of this scale would overlap if inserted</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Clear"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Clear():List[net.psforever.objects.inventory.InventoryItem]"></a><aid="Clear():List[InventoryItem]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Clear():List[net.psforever.objects.inventory.InventoryItem]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Clear</span><spanclass="params">()</span><spanclass="result">: <spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]</span></span><pclass="shortcomment cmt">Clear the inventory by removing all of its items.</p><divclass="fullcomment"><divclass="comment cmt"><p>Clear the inventory by removing all of its items.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>a <code>List</code> of the previous items in the inventory as their <code>InventoryItemData</code> tiles</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.Container#Collisions"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Collisions(index:Int,width:Int,height:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"></a><aid="Collisions(Int,Int,Int):Try[List[InventoryItem]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Collisions(index:Int,width:Int,height:Int):scala.util.Try[List[net.psforever.objects.inventory.InventoryItem]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Collisions</span><spanclass="params">(<spanname="index">index: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="width">width: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="height">height: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.util.Try"class="extype">Try</span>[<spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]]</span></span><pclass="shortcomment cmt">Given a region of "searchable unit positions" considered as stowable,
determine if any previously stowed items are contained within that region.<br>
<br>
Default usage, and recommended the continued inclusion of that use,
is defined in terms of <code>Equipment</code> being stowed in a <code>GridInventory</code>.</p><divclass="fullcomment"><divclass="comment cmt"><p>Given a region of "searchable unit positions" considered as stowable,
determine if any previously stowed items are contained within that region.<br>
<br>
Default usage, and recommended the continued inclusion of that use,
is defined in terms of <code>Equipment</code> being stowed in a <code>GridInventory</code>.
Where the <code>Equipment</code> object is defined by the dimensions <code>width</code> and <code>height</code>,
starting a search at <code>index</code> will search all positions within a grid-like range of numbers.
Under certain searching conditions, this range may be meaningless,
such as is the case when searching individual positions that are normal <code>EquipmentSlot</code> objects.
Regardless, the value collected indicates the potential of multiple objects being discovered and
maintains a reference to the object itself and the slot position where the object is located.
(As any object can be discovered within the range, that is important.)</p></div><dlclass="paramcmts block"><dtclass="param">index</dt><ddclass="cmt"><p>the position to start searching</p></dd><dtclass="param">width</dt><ddclass="cmt"><p>the width of the searchable space</p></dd><dtclass="param">height</dt><ddclass="cmt"><p>the height of the serachable space</p></dd><dt>returns</dt><ddclass="cmt"><p>a list of objects that have been encountered within the searchable space</p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd><dt>See also</dt><dd><spanclass="cmt"><p><code>GridInventory.CheckCollisionsVar</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#ElementsInListCollideInGrid"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="ElementsInListCollideInGrid():List[List[net.psforever.objects.inventory.InventoryItem]]"></a><aid="ElementsInListCollideInGrid():List[List[InventoryItem]]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#ElementsInListCollideInGrid():List[List[net.psforever.objects.inventory.InventoryItem]]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">ElementsInListCollideInGrid</span><spanclass="params">()</span><spanclass="result">: <spanname="scala.List"class="extype">List</span>[<spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]]</span></span><pclass="shortcomment cmt">Check whether any items in the "inventory as a list" datastructure would overlap in the "inventory as a grid".</p><divclass="fullcomment"><divclass="comment cmt"><p>Check whether any items in the "inventory as a list" datastructure would overlap in the "inventory as a grid".
Most likely, if an overlap is discovered,
the grid-space is already compromised by having lost a section of some item's <code>Tile</code>.
The inventory system actually lacks mechanics to properly resolve any discovered issues.
For that reason, it will return a list of overlap issues that need to be resolved by a higher authority.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>a list of item overlap collision combinations</p></dd></dl><dlclass="attributes block"><dt>See also</dt><dd><spanclass="cmt"><p><code>InventoryDisarrayException</code></p></span><spanclass="cmt"><p><code>recursiveRelatedListCollisions</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#ElementsOnGridMatchList"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="ElementsOnGridMatchList():Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#ElementsOnGridMatchList():Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">ElementsOnGridMatchList</span><spanclass="params">()</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span><pclass="shortcomment cmt">Align the "inventory as a grid" with the "inventory as a list."
The grid is a faux-two-dimensional map of object identifiers that should point to items in the list.</p><divclass="fullcomment"><divclass="comment cmt"><p>Align the "inventory as a grid" with the "inventory as a list."
The grid is a faux-two-dimensional map of object identifiers that should point to items in the list.
(Not the same as the global unique identifier number.)
The objects in the list are considered actually being in the inventory.
Only the references to those objects in grid-space can be considered out of alignment
by not pointing to objects in the list.
The inventory as a grid can be repaired but only a higher authority can perform inventory synchronization.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>the number of stale object references found and corrected</p></dd></dl><dlclass="attributes block"><dt>See also</dt><dd><spanclass="cmt"><p><code>InventoryDisarrayException</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Find"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Find(guid:net.psforever.types.PlanetSideGUID):Option[Int]"></a><aid="Find(PlanetSideGUID):Option[Int]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Find(guid:net.psforever.types.PlanetSideGUID):Option[Int]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Find</span><spanclass="params">(<spanname="guid">guid: <ahref="../../types/PlanetSideGUID.html"name="net.psforever.types.PlanetSideGUID"id="net.psforever.types.PlanetSideGUID"class="extype">PlanetSideGUID</a></span>)</span><spanclass="result">: <spanname="scala.Option"class="extype">Option</span>[<spanname="scala.Int"class="extype">Int</span>]</span></span><pclass="shortcomment cmt">Given globally unique identifier, if the object using it is stowed, attempt to locate its slot.</p><divclass="fullcomment"><divclass="comment cmt"><p>Given globally unique identifier, if the object using it is stowed, attempt to locate its slot.
All positions, <code>VisibleSlot</code> and <code>Inventory</code>, and wherever else, should be searchable.</p></div><dlclass="paramcmts block"><dtclass="param">guid</dt><ddclass="cmt"><p>the GUID of the <code>Equipment</code></p></dd><dt>returns</dt><ddclass="cmt"><p>the index of the <code>EquipmentSlot</code>, or <code>None</code></p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref=""name="net.psforever.objects.inventory.GridInventory"id="net.psforever.objects.inventory.GridInventory"class="extype">GridInventory</a> → <ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.Container#Find"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Find(obj:net.psforever.objects.equipment.Equipment):Option[Int]"></a><aid="Find(Equipment):Option[Int]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Find(obj:net.psforever.objects.equipment.Equipment):Option[Int]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Find</span><spanclass="params">(<spanname="obj">obj: <ahref="../equipment/Equipment.html"name="net.psforever.objects.equipment.Equipment"id="net.psforever.objects.equipment.Equipment"class="extype">Equipment</a></span>)</span><spanclass="result">: <spanname="scala.Option"class="extype">Option</span>[<spanname="scala.Int"class="extype">Int</span>]</span></span><pclass="shortcomment cmt">Given an object, attempt to locate its slot.</p><divclass="fullcomment"><divclass="comment cmt"><p>Given an object, attempt to locate its slot.
All positions, <code>VisibleSlot</code> and <code>Inventory</code>, and wherever else, should be searchable.</p></div><dlclass="paramcmts block"><dtclass="param">obj</dt><ddclass="cmt"><p>the <code>Equipment</code> object</p></dd><dt>returns</dt><ddclass="cmt"><p>the index of the <code>EquipmentSlot</code>, or <code>None</code></p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Fit"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Fit(tile:net.psforever.objects.inventory.InventoryTile):Option[Int]"></a><aid="Fit(InventoryTile):Option[Int]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Fit(tile:net.psforever.objects.inventory.InventoryTile):Option[Int]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Fit</span><spanclass="params">(<spanname="tile">tile: <ahref="InventoryTile.html"name="net.psforever.objects.inventory.InventoryTile"id="net.psforever.objects.inventory.InventoryTile"class="extype">InventoryTile</a></span>)</span><spanclass="result">: <spanname="scala.Option"class="extype">Option</span>[<spanname="scala.Int"class="extype">Int</span>]</span></span><pclass="shortcomment cmt">Find a blank space in the current inventory where a <code>tile</code> of given dimensions can be cleanly inserted.</p><divclass="fullcomment"><divclass="comment cmt"><p>Find a blank space in the current inventory where a <code>tile</code> of given dimensions can be cleanly inserted.
Brute-force method.</p></div><dlclass="paramcmts block"><dtclass="param">tile</dt><ddclass="cmt"><p>the dimensions of the blank space</p></dd><dt>returns</dt><ddclass="cmt"><p>the grid index of the upper left corner where equipment to which the <code>tile</code> belongs should be placed</p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref=""name="net.psforever.objects.inventory.GridInventory"id="net.psforever.objects.inventory.GridInventory"class="extype">GridInventory</a> → <ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.Container#Fit"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Fit(obj:net.psforever.objects.equipment.Equipment):Option[Int]"></a><aid="Fit(Equipment):Option[Int]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Fit(obj:net.psforever.objects.equipment.Equipment):Option[Int]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Fit</span><spanclass="params">(<spanname="obj">obj: <ahref="../equipment/Equipment.html"name="net.psforever.objects.equipment.Equipment"id="net.psforever.objects.equipment.Equipment"class="extype">Equipment</a></span>)</span><spanclass="result">: <spanname="scala.Option"class="extype">Option</span>[<spanname="scala.Int"class="extype">Int</span>]</span></span><divclass="fullcomment"><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Height"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Height:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Height:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Height</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Insert"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Insert(start:Int,obj:net.psforever.objects.equipment.Equipment):Boolean"></a><aid="Insert(Int,Equipment):Boolean"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Insert(start:Int,obj:net.psforever.objects.equipment.Equipment):Boolean"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Insert</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="obj">obj: <ahref="../equipment/Equipment.html"name="net.psforever.objects.equipment.Equipment"id="net.psforever.objects.equipment.Equipment"class="extype">Equipment</a></span>)</span><spanclass="result">: <spanname="scala.Boolean"class="extype">Boolean</span></span></span></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#InsertQuickly"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="InsertQuickly(start:Int,obj:net.psforever.objects.equipment.Equipment):Boolean"></a><aid="InsertQuickly(Int,Equipment):Boolean"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#InsertQuickly(start:Int,obj:net.psforever.objects.equipment.Equipment):Boolean"title="Permalink"><iclass="material-icons"><
Having access to all of the available positions is not required.
The entries in this reference should definitely include all unseen positions.
The <code>GridInventory</code> returned by this accessor is also an implementation of <code>Container</code>.</p></div><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref=""name="net.psforever.objects.inventory.GridInventory"id="net.psforever.objects.inventory.GridInventory"class="extype">GridInventory</a> → <ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd><dt>See also</dt><dd><spanclass="cmt"><p><code>VisibleSlots</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Items"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Items:List[net.psforever.objects.inventory.InventoryItem]"></a><aid="Items:List[InventoryItem]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Items:List[net.psforever.objects.inventory.InventoryItem]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Items</span><spanclass="result">: <spanname="scala.List"class="extype">List</span>[<ahref="InventoryItem.html"name="net.psforever.objects.inventory.InventoryItem"id="net.psforever.objects.inventory.InventoryItem"class="extype">InventoryItem</a>]</span></span></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#LastIndex"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="LastIndex:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#LastIndex:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">LastIndex</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span><pclass="shortcomment cmt">The index of the last cell in this inventory.</p><divclass="fullcomment"><divclass="comment cmt"><p>The index of the last cell in this inventory.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>same as <code>Offset</code> plus the total number of cells in this inventory minus 1</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Offset"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Offset:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Offset:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Offset</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Offset_="group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Offset_=(fset:Int):Int"></a><aid="Offset_=(Int):Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Offset_=(fset:Int):Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name"title="gt4s: Offset_$eq">Offset_=</span><spanclass="params">(<spanname="fset">fset: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span><pclass="shortcomment cmt">Change the grid index offset value.</p><divclass="fullcomment"><divclass="comment cmt"><p>Change the grid index offset value.</p></div><dlclass="paramcmts block"><dtclass="param">fset</dt><ddclass="cmt"><p>the new offset value</p></dd><dt>returns</dt><ddclass="cmt"><p>the current offset value
This method replaces mutators for <code>Width</code> and <code>Height</code>.</p></div><dlclass="paramcmts block"><dtclass="param">w</dt><ddclass="cmt"><p>the new width</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the new height</p></dd></dl><dlclass="attributes block"><dt>Exceptions thrown</dt><dd><spanclass="cmt"><p><spanname="IllegalArgumentException"class="extype"><code>IllegalArgumentException</code></span> if the new size to be set is zero or less</p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#SetCells"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="SetCells(start:Int,w:Int,h:Int,value:Int):Unit"></a><aid="SetCells(Int,Int,Int,Int):Unit"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#SetCells(start:Int,w:Int,h:Int,value:Int):Unit"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">SetCells</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="value">value: <spanname="scala.Int"class="extype">Int</span> = <spanclass="symbol">-1</span></span>)</span><spanclass="result">: <spanname="scala.Unit"class="extype">Unit</span></span></span><pclass="shortcomment cmt">Define a region of inventory grid cells and set them to a given value.</p><divclass="fullcomment"><divclass="comment cmt"><p>Define a region of inventory grid cells and set them to a given value.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the initial inventory index</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the region</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the region</p></dd><dtclass="param">value</dt><ddclass="cmt"><p>the value to set all the cells in the defined region;
defaults to -1 (which is "nothing")</p></dd></dl><dlclass="attributes block"><dt>See also</dt><dd><spanclass="cmt"><p><code>SetCellsNoOffset</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#SetCellsNoOffset"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="SetCellsNoOffset(start:Int,w:Int,h:Int,value:Int):Array[Int]"></a><aid="SetCellsNoOffset(Int,Int,Int,Int):Array[Int]"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#SetCellsNoOffset(start:Int,w:Int,h:Int,value:Int):Array[Int]"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">SetCellsNoOffset</span><spanclass="params">(<spanname="start">start: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="w">w: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="h">h: <spanname="scala.Int"class="extype">Int</span></span>, <spanname="value">value: <spanname="scala.Int"class="extype">Int</span> = <spanclass="symbol">-1</span></span>)</span><spanclass="result">: <spanname="scala.Array"class="extype">Array</span>[<spanname="scala.Int"class="extype">Int</span>]</span></span><pclass="shortcomment cmt">Define a region of inventory grid cells and set them to a given value.</p><divclass="fullcomment"><divclass="comment cmt"><p>Define a region of inventory grid cells and set them to a given value.
Perform basic boundary checking for the current inventory dimensions.</p></div><dlclass="paramcmts block"><dtclass="param">start</dt><ddclass="cmt"><p>the initial inventory index, without the inventory offset (required)</p></dd><dtclass="param">w</dt><ddclass="cmt"><p>the width of the region</p></dd><dtclass="param">h</dt><ddclass="cmt"><p>the height of the region</p></dd><dtclass="param">value</dt><ddclass="cmt"><p>the value to set all the cells in the defined region;
defaults to -1 (which is "nothing")</p></dd><dt>returns</dt><ddclass="cmt"><p>a copy of the inventory as a grid, with the anticipated modifications</p></dd></dl><dlclass="attributes block"><dt>Exceptions thrown</dt><dd><spanclass="cmt"><p><spanname="IndexOutOfBoundsException"class="extype"><code>IndexOutOfBoundsException</code></span> if the region extends outside of the grid boundaries</p></span></dd><dt>See also</dt><dd><spanclass="cmt"><p><code>SetCellsOnlyNoOffset</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Size"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Size:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Size:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Size</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Slot"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="Slot(slot:Int):net.psforever.objects.equipment.EquipmentSlot"></a><aid="Slot(Int):EquipmentSlot"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Slot(slot:Int):net.psforever.objects.equipment.EquipmentSlot"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Slot</span><spanclass="params">(<spanname="slot">slot: <spanname="scala.Int"class="extype">Int</span></span>)</span><spanclass="result">: <ahref="../equipment/EquipmentSlot.html"name="net.psforever.objects.equipment.EquipmentSlot"id="net.psforever.objects.equipment.EquipmentSlot"class="extype">EquipmentSlot</a></span></span><pclass="shortcomment cmt">Get whatever is stowed in the inventory at the given index.</p><divclass="fullcomment"><divclass="comment cmt"><p>Get whatever is stowed in the inventory at the given index.</p></div><dlclass="paramcmts block"><dtclass="param">slot</dt><ddclass="cmt"><p>the cell index</p></dd><dt>returns</dt><ddclass="cmt"><p>an <code>EquipmentSlot</code> that contains whatever <code>Equipment</code> was stored in <code>slot</code></p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref=""name="net.psforever.objects.inventory.GridInventory"id="net.psforever.objects.inventory.GridInventory"class="extype">GridInventory</a> → <ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#TotalCapacity"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="TotalCapacity:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#TotalCapacity:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">TotalCapacity</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span><pclass="shortcomment cmt">The total number of cells in this inventory.</p><divclass="fullcomment"><divclass="comment cmt"><p>The total number of cells in this inventory.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>the width multiplied by the height (<code>grid.length</code>, which is the same thing)</p></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#VisibleSlots"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="VisibleSlots:Set[Int]"></a><spanclass="permalink"><ahref="../.
<br>
Having access to all of the available positions is not required.</p><divclass="fullcomment"><divclass="comment cmt"><p>A(n imperfect) reference to a generalized pool of the contained objects.<br>
<br>
Having access to all of the available positions is not required.
Only the positions that can be actively viewed by other clients are listed.</p></div><dlclass="paramcmts block"><dt>returns</dt><ddclass="cmt"><p>all of the affected slot indices</p></dd></dl><dlclass="attributes block"><dt>Definition Classes</dt><dd><ahref=""name="net.psforever.objects.inventory.GridInventory"id="net.psforever.objects.inventory.GridInventory"class="extype">GridInventory</a> → <ahref="Container.html"name="net.psforever.objects.inventory.Container"id="net.psforever.objects.inventory.Container"class="extype">Container</a></dd><dt>See also</dt><dd><spanclass="cmt"><p><code>Inventory</code></p></span></dd></dl></div></li><liclass="indented0 "name="net.psforever.objects.inventory.GridInventory#Width"group="Ungrouped"fullComment="no"data-isabs="false"visbl="pub"><aid="Width:Int"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#Width:Int"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">Width</span><spanclass="result">: <spanname="scala.Int"class="extype">Int</span></span></span></li><liclass="indented0 "name="scala.Any#asInstanceOf"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="asInstanceOf[T0]:T0"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#asInstanceOf[T0]:T0"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier">final </span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">asInstanceOf</span><spanclass="tparams">[<spanname="T0">T0</span>]</span><spanclass="result">: <spanname="scala.Any.asInstanceOf.T0"class="extype">T0</span></span></span><divclass="fullcomment"><dlclass="attributes block"><dt>Definition Classes</dt><dd>Any</dd></dl></div></li><liclass="indented0 "name="scala.AnyRef#clone"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="prt"><aid="clone():Object"></a><aid="clone():AnyRef"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#clone():Object"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier"></span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">clone</span><spanclass="params">()</span><spanclass="result">: <spanname="scala.AnyRef"class="extype">AnyRef</span></span></span><divclass="fullcomment"><dlclass="attributes block"><dt>Attributes</dt><dd>protected[<spanname="java.lang"class="extype">lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd><spanclass="name">@throws</span><spanclass="args">(<span><spanclass="defval">classOf[java.lang.CloneNotSupportedException]</span></span>)</span><spanclass="name">@native</span><spanclass="args">()</span></dd></dl></div></li><liclass="indented0 "name="scala.AnyRef#eq"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="eq(x$1:AnyRef):Boolean"></a><aid="eq(AnyRef):Boolean"></a><spanclass="permalink"><ahref="../../../../net/psforever/objects/inventory/GridInventory.html#eq(x$1:AnyRef):Boolean"title="Permalink"><iclass="material-icons"></i></a></span><spanclass="modifier_kind"><spanclass="modifier">final </span><spanclass="kind">def</span></span><spanclass="symbol"><spanclass="name">eq</span><spanclass="params">(<spanname="arg0">arg0: <spanname="scala.AnyRef"class="extype">AnyRef</span></span>)</span><spanclass="result">: <spanname="scala.Boolean"class="extype">Boolean</span></span></span><divclass="fullcomment"><dlclass="attributes block"><dt>Definition Classes</dt><dd>AnyRef</dd></dl></div></li><liclass="indented0 "name="scala.AnyRef#equals"group="Ungrouped"fullComment="yes"data-isabs="false"visbl="pub"><aid="equals(x$1:Object):Boolean"></a><aid="equals(AnyRef):Boolean"></a><spanclass="permali