|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectContainer
Thing
Item
Beer
public class Beer
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 |
|---|
public Beer()
public Beer(int alcohol)
alcohol - strength level this potion can increase| Method Detail |
|---|
public int getStrength()
public boolean canPickUp()
canPickUp in class Itempublic ThingType getThingType()
BEER.
getThingType in class ThingThingType.BEERpublic Outcome useItem()
useItem in class Item
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||