zombie.inventory
Class ItemContainer
java.lang.Object
zombie.inventory.ItemContainer
public class ItemContainer
- extends java.lang.Object
- Author:
- LEMMY
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
public InventoryItem containingItem
Items
public java.util.ArrayList<InventoryItem> Items
parent
public IsoObject parent
SourceGrid
public IsoGridSquare SourceGrid
bExplored
public boolean bExplored
ContainerIDSet
public static java.util.Stack<java.lang.Integer> ContainerIDSet
type
public java.lang.String type
IDMax
public static int IDMax
ID
public int ID
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()
getCapacity
public int getCapacity()
setExplored
public void setExplored(boolean b)
hasRoomFor
public boolean hasRoomFor(InventoryItem item)
isExplored
public boolean isExplored()
isInCharacterInventory
public boolean isInCharacterInventory(IsoGameCharacter chr)
isInside
public boolean isInside(InventoryItem item)
getContainingItem
public InventoryItem getContainingItem()
getPackWithSpace
public InventoryContainer getPackWithSpace(float weightNeeded)
DoAddItem
public InventoryItem DoAddItem(InventoryItem item)
DoAddItemBlind
public InventoryItem DoAddItemBlind(InventoryItem item)
AddItems
public java.util.ArrayList<InventoryItem> AddItems(java.lang.String item,
int use)
AddItems
public void AddItems(InventoryItem item,
int use)
getNumberOfItem
public int getNumberOfItem(java.lang.String findItem)
addItem
public InventoryItem addItem(InventoryItem item)
AddItem
public InventoryItem AddItem(InventoryItem item)
AddItemBlind
public InventoryItem AddItemBlind(InventoryItem item)
AddItem
public InventoryItem AddItem(java.lang.String type)
AddItem
public boolean AddItem(java.lang.String type,
float useDelta)
contains
public boolean contains(InventoryItem item)
contains
public boolean contains(java.lang.String type)
getBestCondition
public InventoryItem getBestCondition(java.lang.String String)
FindAndReturn
public InventoryItem FindAndReturn(java.lang.String String)
FindAndReturnStack
public InventoryItem FindAndReturnStack(java.lang.String String)
FindAndReturnStack
public InventoryItem FindAndReturnStack(InventoryItem itemlike)
HasType
public boolean HasType(ItemType itemType)
Remove
public void Remove(InventoryItem item)
DoRemoveItem
public void DoRemoveItem(InventoryItem item)
Remove
public void Remove(java.lang.String itemTypes)
- Remove one item of the tyupe in parameter inside the container
Ex of itemType : Broccoli (no need the module like Base.Broccoli)
- Parameters:
itemType
-
Remove
public InventoryItem Remove(ItemType itemType)
Find
public InventoryItem Find(ItemType itemType)
RemoveAll
public void RemoveAll(java.lang.String itemType)
- Remove all the item of the type in parameter inside the container
Ex of itemType : Broccoli (no need the module like Base.Broccoli)
- Parameters:
itemType
-
RemoveOneOf
public void RemoveOneOf(java.lang.String String)
getWeight
public int getWeight()
- Deprecated. Use getRealWeight() instead (RobertJohnson)
- Returns:
getRealWeight
public float getRealWeight()
- Get the weight inside a inventory, also check if there is another inventory inside it to count his item too
apply the weight reduction if there is one
- Returns:
getMaxWeight
public float getMaxWeight()
getCapacityWeight
public float getCapacityWeight()
age
public void age()
getTemprature
public float getTemprature()
RequireUpdate
public boolean RequireUpdate()
save
public void save(java.nio.ByteBuffer output)
throws java.io.IOException
- Throws:
java.io.IOException
load
public void load(java.nio.ByteBuffer input)
throws java.io.IOException
- Throws:
java.io.IOException
isDrawDirty
public boolean isDrawDirty()
setDrawDirty
public void setDrawDirty(boolean b)
getBestWeapon
public InventoryItem getBestWeapon(SurvivorDesc desc)
getBestWeapon
public InventoryItem getBestWeapon()
getTotalFoodScore
public float getTotalFoodScore(SurvivorDesc desc)
getTotalWeaponScore
public float getTotalWeaponScore(SurvivorDesc desc)
getBestFood
public InventoryItem getBestFood(SurvivorDesc descriptor)
getBestBandage
public InventoryItem getBestBandage(SurvivorDesc descriptor)
getNumItems
public int getNumItems(java.lang.String item)
isActive
public boolean isActive()
- Returns:
- the active
setActive
public void setActive(boolean active)
- Parameters:
active
- the active to set
isDirty
public boolean isDirty()
- Returns:
- the dirty
setDirty
public void setDirty(boolean dirty)
- Parameters:
dirty
- the dirty to set
isIsDevice
public boolean isIsDevice()
- Returns:
- the IsDevice
setIsDevice
public void setIsDevice(boolean IsDevice)
- Parameters:
IsDevice
- the IsDevice to set
getAgeFactor
public float getAgeFactor()
- Returns:
- the ageFactor
setAgeFactor
public void setAgeFactor(float ageFactor)
- Parameters:
ageFactor
- the ageFactor to set
getCookingFactor
public float getCookingFactor()
- Returns:
- the CookingFactor
setCookingFactor
public void setCookingFactor(float CookingFactor)
- Parameters:
CookingFactor
- the CookingFactor to set
getItems
public java.util.ArrayList<InventoryItem> getItems()
- Returns:
- the Items
setItems
public void setItems(java.util.ArrayList<InventoryItem> Items)
- Parameters:
Items
- the Items to set
getParent
public IsoObject getParent()
- Returns:
- the parent
setParent
public void setParent(IsoObject parent)
- Parameters:
parent
- the parent to set
getSourceGrid
public IsoGridSquare getSourceGrid()
- Returns:
- the SourceGrid
setSourceGrid
public void setSourceGrid(IsoGridSquare SourceGrid)
- Parameters:
SourceGrid
- the SourceGrid to set
getType
public java.lang.String getType()
- Returns:
- the type
setType
public void setType(java.lang.String type)
- Parameters:
type
- the type to set
clear
public void clear()
getWaterContainerCount
public int getWaterContainerCount()
FindWaterSource
public InventoryItem FindWaterSource()
getAllWaterFillables
public java.util.ArrayList<InventoryItem> getAllWaterFillables()
getItemCount
public int getItemCount(java.lang.String type)
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()