org.haphazard.character.inventory
Class RelaxedBestFit

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

public class RelaxedBestFit
extends java.lang.Object
implements InventoryAlgorithm


Constructor Summary
RelaxedBestFit()
          Creates a new instance of RelaxedBestFit
 
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

RelaxedBestFit

public RelaxedBestFit()
Creates a new instance of RelaxedBestFit

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