org.haphazard.character.inventory
Class Random

java.lang.Object
  extended byorg.haphazard.character.inventory.Random
All Implemented Interfaces:
InventoryAlgorithm

public class Random
extends java.lang.Object
implements InventoryAlgorithm


Constructor Summary
Random()
          Creates a new instance of Random
 
Method Summary
 boolean add(Item item, java.util.Vector containers)
          Adds an item to a container
 boolean canHold(Item item, java.util.Vector containers)
          Checks if the specified containers can hold the specified item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random()
Creates a new instance of Random

Method Detail

add

public boolean add(Item item,
                   java.util.Vector containers)
Adds an item to a container

Specified by:
add in interface InventoryAlgorithm
Parameters:
item - The item to add
containers - The number of containers to use for adding
Returns:
True if the item could be fit

canHold

public boolean canHold(Item item,
                       java.util.Vector containers)
Checks if the specified containers can hold the specified item

Specified by:
canHold in interface InventoryAlgorithm
Parameters:
item - The item to hold
containers - The containers to use to store the item
Returns:
True if the containers can hold the item