Package zombie.inventory
Class ItemContainer
java.lang.Object
zombie.inventory.ItemContainer
public class ItemContainer
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description boolean
active
float
ageFactor
boolean
bExplored
int
Capacity
InventoryItem
containingItem
float
CookingFactor
boolean
dirty
int
ID
java.util.ArrayList
IncludingObsoleteItems
InventoryContainer
inventoryContainer
boolean
IsDevice
java.util.ArrayList
Items
IsoObject
parent
IsoGridSquare
SourceGrid
java.lang.String
type
-
Constructor Summary
Constructors Constructor Description ItemContainer()
ItemContainer(int ID)
ItemContainer(int ID, java.lang.String containerName, IsoGridSquare square, IsoObject parent, int wid, int hei)
ItemContainer(java.lang.String containerName, IsoGridSquare square, IsoObject parent, int wid, int hei)
-
Method Summary
Modifier and Type Method Description InventoryItem
addItem(InventoryItem item)
InventoryItem
AddItem(java.lang.String type)
boolean
AddItem(java.lang.String type, float useDelta)
InventoryItem
AddItem(InventoryItem item)
InventoryItem
AddItemBlind(InventoryItem item)
void
addItemOnServer(InventoryItem item)
java.util.ArrayList
AddItems(java.lang.String item, int use)
void
AddItems(InventoryItem item, int use)
void
addItemsToProcessItems()
void
clear()
boolean
contains(java.lang.String type)
boolean
contains(java.lang.String type, boolean doInv)
boolean
contains(InventoryItem item)
boolean
contains(InventoryItem itemToFind, boolean doInv)
boolean
containsID(long id)
boolean
containsWithModule(java.lang.String moduleType)
boolean
containsWithModule(java.lang.String moduleType, boolean withDeltaLeft)
InventoryItem
DoAddItem(InventoryItem item)
InventoryItem
DoAddItemBlind(InventoryItem item)
boolean
doLoad()
boolean
doLoadActual()
void
DoRemoveItem(InventoryItem item)
void
emptyIt()
InventoryItem
Find(ItemType itemType)
java.util.ArrayList
FindAll(java.lang.String itemType)
InventoryItem
FindAndReturn(java.lang.String String)
java.util.ArrayList
FindAndReturn(java.lang.String String, int count)
InventoryItem
FindAndReturn(java.lang.String String, java.util.ArrayList itemToCheck)
InventoryItem
FindAndReturnCategory(java.lang.String category)
InventoryItem
FindAndReturnStack(java.lang.String String)
InventoryItem
FindAndReturnStack(InventoryItem itemlike)
InventoryItem
FindAndReturnWaterItem(int uses)
InventoryItem
FindWaterSource()
float
floatingPointCorrection(float val)
float
getAgeFactor()
java.util.LinkedHashMap
getAllItems(java.util.LinkedHashMap items, boolean inInv)
java.util.ArrayList
getAllWaterFillables()
InventoryItem
getBestBandage(SurvivorDesc descriptor)
InventoryItem
getBestCondition(java.lang.String String)
InventoryItem
getBestFood(SurvivorDesc descriptor)
InventoryItem
getBestWeapon()
InventoryItem
getBestWeapon(SurvivorDesc desc)
int
getCapacity()
float
getCapacityWeight()
IsoGameCharacter
getCharacter()
java.lang.String
getCloseSound()
InventoryItem
getContainingItem()
float
getContentsWeight()
float
getCookingFactor()
float
getCustomTemperature()
int
getEffectiveCapacity(IsoGameCharacter chr)
InventoryItem
getItemById(long id)
int
getItemCount(java.lang.String type)
int
getItemCount(java.lang.String type, boolean doBags)
InventoryItem
getItemFromType(java.lang.String type)
InventoryItem
getItemFromType(java.lang.String type, IsoGameCharacter chr, boolean notEquipped)
java.util.ArrayList
getItems()
java.util.ArrayList
getItemsFromCategory(java.lang.String category)
java.util.ArrayList
getItemsFromFullType(java.lang.String type)
java.util.ArrayList
getItemsFromFullType(java.lang.String type, boolean includeInv)
java.util.ArrayList
getItemsFromType(java.lang.String type)
java.util.ArrayList
getItemsFromType(java.lang.String type, boolean includeInv)
InventoryItem
getItemWithID(long id)
float
getMaxWeight()
int
getNumberOfItem(java.lang.String findItem)
int
getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete)
int
getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete, boolean insideInv)
int
getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete, java.util.ArrayList containers)
int
getNumItems(java.lang.String item)
java.lang.String
getOnlyAcceptCategory()
java.lang.String
getOpenSound()
IsoObject
getParent()
java.lang.String
getPutSound()
IsoGridSquare
getSourceGrid()
float
getTemprature()
float
getTotalFoodScore(SurvivorDesc desc)
float
getTotalWeaponScore(SurvivorDesc desc)
java.lang.String
getType()
int
getWaterContainerCount()
int
getWeight()
int
getWeightReduction()
boolean
hasRoomFor(IsoGameCharacter chr, float weightVal)
boolean
hasRoomFor(IsoGameCharacter chr, InventoryItem item)
boolean
HasType(ItemType itemType)
InventoryItem
haveThisKeyId(int keyId)
boolean
isActive()
boolean
isDirty()
boolean
isDrawDirty()
boolean
isExplored()
boolean
isHasBeenLooted()
boolean
isInCharacterInventory(IsoGameCharacter chr)
boolean
isInside(InventoryItem item)
boolean
isIsDevice()
boolean
isPowered()
boolean
isTemperatureChanging()
void
load(java.nio.ByteBuffer input, int WorldVersion, boolean net)
void
Remove(java.lang.String itemTypes)
void
Remove(InventoryItem item)
InventoryItem
Remove(ItemType itemType)
void
RemoveAll(java.lang.String itemType)
void
removeAllItems()
void
removeItemOnServer(InventoryItem item)
void
removeItemsFromProcessItems()
boolean
removeItemWithID(long id)
boolean
removeItemWithIDRecurse(long id)
void
RemoveOneOf(java.lang.String String)
boolean
RemoveOneOf(java.lang.String String, boolean insideInv)
void
requestServerItemsForContainer()
void
save(java.nio.ByteBuffer output, boolean net)
void
sendContentsToRemoteContainer()
void
sendContentsToRemoteContainer(UdpConnection connection)
Deprecated.void
setActive(boolean active)
void
setAgeFactor(float ageFactor)
void
setCloseSound(java.lang.String closeSound)
void
setCookingFactor(float CookingFactor)
void
setCustomTemperature(float newTemp)
void
setDirty(boolean dirty)
void
setDrawDirty(boolean b)
void
setExplored(boolean b)
void
setHasBeenLooted(boolean hasBeenLooted)
void
setIsDevice(boolean IsDevice)
void
setItems(java.util.ArrayList Items)
void
setOnlyAcceptCategory(java.lang.String onlyAcceptCategory)
void
setOpenSound(java.lang.String openSound)
void
setParent(IsoObject parent)
void
setPutSound(java.lang.String putSound)
void
setSourceGrid(IsoGridSquare SourceGrid)
void
setType(java.lang.String type)
void
setWeightReduction(int weightReduction)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
active
public boolean active -
dirty
public boolean dirty -
IsDevice
public boolean IsDevice -
ageFactor
public float ageFactor -
CookingFactor
public float CookingFactor -
Capacity
public int Capacity -
containingItem
-
Items
public java.util.ArrayList Items -
IncludingObsoleteItems
public java.util.ArrayList IncludingObsoleteItems -
parent
-
SourceGrid
-
inventoryContainer
-
bExplored
public boolean bExplored -
type
public java.lang.String type -
ID
public int ID
-
-
Constructor Details
-
ItemContainer
public ItemContainer(int ID, java.lang.String containerName, IsoGridSquare square, IsoObject parent, int wid, int hei) -
ItemContainer
public ItemContainer(java.lang.String containerName, IsoGridSquare square, IsoObject parent, int wid, int hei) -
ItemContainer
public ItemContainer(int ID) -
ItemContainer
public ItemContainer()
-
-
Method Details
-
getCapacity
public int getCapacity() -
FindAndReturnWaterItem
-
getEffectiveCapacity
-
setExplored
public void setExplored(boolean b) -
hasRoomFor
-
hasRoomFor
-
isExplored
public boolean isExplored() -
isInCharacterInventory
-
isInside
-
getContainingItem
-
DoAddItem
-
DoAddItemBlind
-
AddItems
public java.util.ArrayList AddItems(java.lang.String item, int use) -
AddItems
-
getNumberOfItem
public int getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete) -
getNumberOfItem
public int getNumberOfItem(java.lang.String findItem) -
getNumberOfItem
public int getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete, java.util.ArrayList containers) -
getNumberOfItem
public int getNumberOfItem(java.lang.String findItem, boolean includeReplaceOnDeplete, boolean insideInv) -
addItem
-
AddItem
-
AddItemBlind
-
AddItem
-
AddItem
public boolean AddItem(java.lang.String type, float useDelta) -
contains
-
containsWithModule
public boolean containsWithModule(java.lang.String moduleType) -
containsWithModule
public boolean containsWithModule(java.lang.String moduleType, boolean withDeltaLeft) -
removeItemOnServer
-
addItemOnServer
-
contains
-
contains
public boolean contains(java.lang.String type, boolean doInv) -
contains
public boolean contains(java.lang.String type) -
getBestCondition
-
FindAndReturnCategory
-
FindAndReturn
public java.util.ArrayList FindAndReturn(java.lang.String String, int count) -
FindAndReturn
-
FindAndReturn
-
FindAll
public java.util.ArrayList FindAll(java.lang.String itemType) -
FindAndReturnStack
-
FindAndReturnStack
-
HasType
-
Remove
-
DoRemoveItem
-
Remove
public void Remove(java.lang.String itemTypes) -
Remove
-
Find
-
RemoveAll
public void RemoveAll(java.lang.String itemType) -
RemoveOneOf
public boolean RemoveOneOf(java.lang.String String, boolean insideInv) -
RemoveOneOf
public void RemoveOneOf(java.lang.String String) -
getWeight
public int getWeight() -
getContentsWeight
public float getContentsWeight() -
getMaxWeight
public float getMaxWeight() -
getCapacityWeight
public float getCapacityWeight() -
isPowered
public boolean isPowered() -
getTemprature
public float getTemprature() -
isTemperatureChanging
public boolean isTemperatureChanging() -
save
public void save(java.nio.ByteBuffer output, boolean net) throws java.io.IOException- Throws:
java.io.IOException
-
load
public void load(java.nio.ByteBuffer input, int WorldVersion, boolean net) throws java.io.IOException- Throws:
java.io.IOException
-
isDrawDirty
public boolean isDrawDirty() -
setDrawDirty
public void setDrawDirty(boolean b) -
getBestWeapon
-
getBestWeapon
-
getTotalFoodScore
-
getTotalWeaponScore
-
getBestFood
-
getBestBandage
-
getNumItems
public int getNumItems(java.lang.String item) -
isActive
public boolean isActive() -
setActive
public void setActive(boolean active) -
isDirty
public boolean isDirty() -
setDirty
public void setDirty(boolean dirty) -
isIsDevice
public boolean isIsDevice() -
setIsDevice
public void setIsDevice(boolean IsDevice) -
getAgeFactor
public float getAgeFactor() -
setAgeFactor
public void setAgeFactor(float ageFactor) -
getCookingFactor
public float getCookingFactor() -
setCookingFactor
public void setCookingFactor(float CookingFactor) -
getItems
public java.util.ArrayList getItems() -
setItems
public void setItems(java.util.ArrayList Items) -
getParent
-
setParent
-
getSourceGrid
-
setSourceGrid
-
getType
public java.lang.String getType() -
setType
public void setType(java.lang.String type) -
clear
public void clear() -
getWaterContainerCount
public int getWaterContainerCount() -
FindWaterSource
-
getAllWaterFillables
public java.util.ArrayList getAllWaterFillables() -
getItemCount
public int getItemCount(java.lang.String type) -
getItemCount
public int getItemCount(java.lang.String type, boolean doBags) -
setWeightReduction
public void setWeightReduction(int weightReduction) -
getWeightReduction
public int getWeightReduction() -
doLoad
public boolean doLoad() -
doLoadActual
public boolean doLoadActual() throws java.io.FileNotFoundException, java.io.IOException- Throws:
java.io.FileNotFoundException
java.io.IOException
-
removeAllItems
public void removeAllItems() -
setCustomTemperature
public void setCustomTemperature(float newTemp) -
getCustomTemperature
public float getCustomTemperature() -
getItemFromType
public InventoryItem getItemFromType(java.lang.String type, IsoGameCharacter chr, boolean notEquipped) -
getItemFromType
-
getItemsFromType
public java.util.ArrayList getItemsFromType(java.lang.String type) -
getItemsFromFullType
public java.util.ArrayList getItemsFromFullType(java.lang.String type) -
getItemsFromFullType
public java.util.ArrayList getItemsFromFullType(java.lang.String type, boolean includeInv) -
getItemsFromType
public java.util.ArrayList getItemsFromType(java.lang.String type, boolean includeInv) -
getItemsFromCategory
public java.util.ArrayList getItemsFromCategory(java.lang.String category) -
sendContentsToRemoteContainer
public void sendContentsToRemoteContainer() -
requestServerItemsForContainer
public void requestServerItemsForContainer() -
sendContentsToRemoteContainer
Deprecated. -
getItemWithID
-
removeItemWithID
public boolean removeItemWithID(long id) -
containsID
public boolean containsID(long id) -
removeItemWithIDRecurse
public boolean removeItemWithIDRecurse(long id) -
isHasBeenLooted
public boolean isHasBeenLooted() -
setHasBeenLooted
public void setHasBeenLooted(boolean hasBeenLooted) -
getOpenSound
public java.lang.String getOpenSound() -
setOpenSound
public void setOpenSound(java.lang.String openSound) -
getCloseSound
public java.lang.String getCloseSound() -
setCloseSound
public void setCloseSound(java.lang.String closeSound) -
getPutSound
public java.lang.String getPutSound() -
setPutSound
public void setPutSound(java.lang.String putSound) -
haveThisKeyId
-
getOnlyAcceptCategory
public java.lang.String getOnlyAcceptCategory() -
setOnlyAcceptCategory
public void setOnlyAcceptCategory(java.lang.String onlyAcceptCategory) -
getCharacter
-
emptyIt
public void emptyIt() -
getAllItems
public java.util.LinkedHashMap getAllItems(java.util.LinkedHashMap items, boolean inInv) -
getItemById
-
floatingPointCorrection
public float floatingPointCorrection(float val) -
addItemsToProcessItems
public void addItemsToProcessItems() -
removeItemsFromProcessItems
public void removeItemsFromProcessItems()
-