expanding Container functionality to include Fit tests; handling LootItemMessage packets

This commit is contained in:
FateJH 2018-05-10 19:41:31 -04:00
parent 0590b575d0
commit 65c8de0790
4 changed files with 192 additions and 116 deletions

View file

@ -18,8 +18,6 @@ class LockerContainer extends Equipment with Container {
def VisibleSlots : Set[Int] = Set.empty[Int]
def Fit(obj : Equipment) : Option[Int] = inventory.Fit(obj.Definition.Tile)
def Definition : EquipmentDefinition = GlobalDefinitions.locker_container
}

View file

@ -154,7 +154,7 @@ class Player(private val core : Avatar) extends PlanetSideGameObject with Factio
def Locker : LockerContainer = core.Locker
def Fit(obj : Equipment) : Option[Int] = {
override def Fit(obj : Equipment) : Option[Int] = {
recursiveHolsterFit(holsters.iterator, obj.Size) match {
case Some(index) =>
Some(index)

View file

@ -42,6 +42,10 @@ trait Container {
*/
def Find(guid : PlanetSideGUID) : Option[Int] = Inventory.Find(guid)
def Fit(obj : Equipment) : Option[Int] = Fit(obj.Definition.Tile)
def Fit(tile : InventoryTile) : Option[Int] = Inventory.Fit(tile)
/**
* A(n imperfect) reference to a generalized pool of the contained objects.<br>
* <br>