Class Beer

java.lang.Object
  extended by Container
      extended by Thing
          extended by Item
              extended by Beer

public class Beer
extends Item

A keg of beer. Beer can be picked up and used (drunk) by a person. If a warrior drinks beer, he gets drunk and his strength level goes down by the alcohol strength of the beer. If a guard drinks beer, he totally enjoys it. His strength level stays the same, but he will let everybody pass through the exit he's guarding.


Constructor Summary
Beer()
          Creates a new keg of beer with the default alcohol strength of 1.
Beer(int alcohol)
          Creates a new keg of beer with the specified alcohol strength
 
Method Summary
 boolean canPickUp()
          Beer can be picked up.
 int getStrength()
          Get alcohol strength of this beer
 ThingType getThingType()
          The thing type of beer is BEER.
 Outcome useItem()
          Beer is drunk.
 
Methods inherited from class Item
toString
 
Methods inherited from class Thing
getContainer, removeSelf, setContainer
 
Methods inherited from class Container
addThing, copy, empty, find, findThing, getContents, getNumberOfThingType, getSize, removeThing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Beer

public Beer()
Creates a new keg of beer with the default alcohol strength of 1.


Beer

public Beer(int alcohol)
Creates a new keg of beer with the specified alcohol strength

Parameters:
alcohol - strength level this potion can increase
Method Detail

getStrength

public int getStrength()
Get alcohol strength of this beer

Returns:
alcohol strength

canPickUp

public boolean canPickUp()
Beer can be picked up.

Specified by:
canPickUp in class Item
Returns:
true

getThingType

public ThingType getThingType()
The thing type of beer is BEER.

Specified by:
getThingType in class Thing
Returns:
ThingType.BEER

useItem

public Outcome useItem()
Beer is drunk. It is then discarded (removed from its container).

Specified by:
useItem in class Item
Returns:
the alcohol strength of the drunk beer