us.asciiroth.client.board
Class ItemBag

java.lang.Object
  extended by us.asciiroth.client.core.Bag<Item>
      extended by us.asciiroth.client.board.ItemBag

public class ItemBag
extends Bag<Item>

A bag representing the items in a cell. Following the simple C --> M --> V design of the application, this decorates a bag and adds updates to the map/view.


Nested Class Summary
 
Nested classes/interfaces inherited from class us.asciiroth.client.core.Bag
Bag.Entry<T extends Piece>
 
Constructor Summary
ItemBag(Cell cell)
          Constructor.
 
Method Summary
 void add(int index, Item item)
          Add an item to the bag at the indicated index.
 void add(Item item)
          Add one count of an item to the bag.
 boolean containsMeat()
          Does this bag contain a bone, fish, or similar meat-type item? Carnivores (dumb ones) will chase after these rather than the player.
 void remove(Item item)
          Remove one count of an item from the bag.
 
Methods inherited from class us.asciiroth.client.core.Bag
asEntryList, contains, findEntry, get, getCount, getIndex, isEmpty, last, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemBag

public ItemBag(Cell cell)
Constructor.

Parameters:
cell -
Method Detail

add

public void add(int index,
                Item item)
Description copied from class: Bag
Add an item to the bag at the indicated index. Used in an attempt to manipulate what you can see in the effects layer.

Overrides:
add in class Bag<Item>

add

public void add(Item item)
Description copied from class: Bag
Add one count of an item to the bag.

Overrides:
add in class Bag<Item>

containsMeat

public boolean containsMeat()
Does this bag contain a bone, fish, or similar meat-type item? Carnivores (dumb ones) will chase after these rather than the player.

Returns:
true if there's at least one bone or fish on the cell

remove

public void remove(Item item)
Description copied from class: Bag
Remove one count of an item from the bag.

Overrides:
remove in class Bag<Item>

0.7

2009 Alx Dark