zombie.inventory
Class ItemContainer

java.lang.Object
  extended by zombie.inventory.ItemContainer

public class ItemContainer
extends java.lang.Object

Author:
LEMMY

Field Summary
 boolean active
           
 float ageFactor
           
 boolean bExplored
           
 int Capacity
           
static java.util.Stack<java.lang.Integer> ContainerIDSet
           
 InventoryItem containingItem
           
 float CookingFactor
           
 boolean dirty
           
 int ID
           
static int IDMax
           
 boolean IsDevice
           
 java.util.ArrayList<InventoryItem> Items
           
 IsoObject parent
           
 IsoGridSquare SourceGrid
           
 java.lang.String type
           
 
Constructor Summary
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
 InventoryItem addItem(InventoryItem item)
           
 InventoryItem AddItem(InventoryItem item)
           
 InventoryItem AddItem(java.lang.String type)
           
 boolean AddItem(java.lang.String type, float useDelta)
           
 InventoryItem AddItemBlind(InventoryItem item)
           
 void AddItems(InventoryItem item, int use)
           
 java.util.ArrayList<InventoryItem> AddItems(java.lang.String item, int use)
           
 void age()
           
 void clear()
           
 boolean contains(InventoryItem item)
           
 boolean contains(java.lang.String type)
           
 InventoryItem DoAddItem(InventoryItem item)
           
 InventoryItem DoAddItemBlind(InventoryItem item)
           
 boolean doLoad()
           
 boolean doLoadActual()
           
 void DoRemoveItem(InventoryItem item)
           
 InventoryItem Find(ItemType itemType)
           
 InventoryItem FindAndReturn(java.lang.String String)
           
 InventoryItem FindAndReturnStack(InventoryItem itemlike)
           
 InventoryItem FindAndReturnStack(java.lang.String String)
           
 InventoryItem FindWaterSource()
           
 float getAgeFactor()
           
 java.util.ArrayList<InventoryItem> 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()
           
 InventoryItem getContainingItem()
           
 float getCookingFactor()
           
 int getItemCount(java.lang.String type)
           
 java.util.ArrayList<InventoryItem> getItems()
           
 float getMaxWeight()
           
 int getNumberOfItem(java.lang.String findItem)
           
 int getNumItems(java.lang.String item)
           
 InventoryContainer getPackWithSpace(float weightNeeded)
           
 IsoObject getParent()
           
 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
 IsoGridSquare getSourceGrid()
           
 float getTemprature()
           
 float getTotalFoodScore(SurvivorDesc desc)
           
 float getTotalWeaponScore(SurvivorDesc desc)
           
 java.lang.String getType()
           
 int getWaterContainerCount()
           
 int getWeight()
          Deprecated. Use getRealWeight() instead (RobertJohnson)
 int getWeightReduction()
           
 boolean hasRoomFor(InventoryItem item)
           
 boolean HasType(ItemType itemType)
           
 boolean isActive()
           
 boolean isDirty()
           
 boolean isDrawDirty()
           
 boolean isExplored()
           
 boolean isInCharacterInventory(IsoGameCharacter chr)
           
 boolean isInside(InventoryItem item)
           
 boolean isIsDevice()
           
 void load(java.nio.ByteBuffer input)
           
 void Remove(InventoryItem item)
           
 InventoryItem Remove(ItemType itemType)
           
 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)
 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)
 void removeAllItems()
           
 void RemoveOneOf(java.lang.String String)
           
 boolean RequireUpdate()
           
 void save(java.nio.ByteBuffer output)
           
 void setActive(boolean active)
           
 void setAgeFactor(float ageFactor)
           
 void setCookingFactor(float CookingFactor)
           
 void setDirty(boolean dirty)
           
 void setDrawDirty(boolean b)
           
 void setExplored(boolean b)
           
 void setIsDevice(boolean IsDevice)
           
 void setItems(java.util.ArrayList<InventoryItem> Items)
           
 void setParent(IsoObject parent)
           
 void setSourceGrid(IsoGridSquare SourceGrid)
           
 void setType(java.lang.String type)
           
 void setWeightReduction(int weightReduction)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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 Detail

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()