|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.globalse.arena.frag.objects.FRAGObject | +--org.globalse.arena.sword.engine.Item
Item is any object in the game that an adventurer can pick up. The information about the item is stored in its properties. All the items relevant to the choosen mission are placed in the game world by the Sword class once a new game is started or a running one is joined.
FRAGObject
,
Sword
, Serialized Form
Field Summary | |
double |
weight
|
Fields inherited from class org.globalse.arena.frag.objects.FRAGObject |
controller,
gameName,
influenceRange,
objectName,
owner,
position,
visibilityRange |
Constructor Summary | |
Item()
|
Method Summary | |
void |
actionEvent(ObjectActionEvent event)
Processes the ObjectActionEvent s that the ObjectManager
receives for this object. |
MathVector |
checkCollision(java.lang.String other,
MathVector oldPos,
MathVector delta)
Checks possible collisions of this item with other objects. |
void |
draw(DrawManager drawManager)
Draws the Item on the screen, according to his current coordinates and visibility |
double |
getCollisionSphere()
Returns the collisonSphere property of this item |
java.lang.String |
getDescription()
Returns a string that can be displayed on the UI and contains all relevant information about the Item. |
MathVector |
getDimensions()
Returns the dimensions of the item. |
java.awt.Image |
getImage()
Returns an image that represents the item. |
java.lang.String |
getObjectName()
Returns the unique object name of the Item. |
java.lang.String |
getType()
Returns the type of this item (sword, apple, ring, ...) |
boolean |
getVisible()
Returns whether the item is currently visible on the map or not |
void |
init(java.lang.String gameName,
java.lang.String objectName,
double weight,
java.lang.String type)
The constructor creates a new Item object, depending on the following parameters: |
boolean |
isItemUsableBy(java.lang.String owner)
Checks if this item is currently used by someone |
void |
setVisible(boolean visible)
Sets the visibilty attribute of the item |
boolean |
useWith(java.lang.String target)
Doesn't do anything, since all objects, instances of the Item class are by definition useless. |
Methods inherited from class org.globalse.arena.frag.objects.FRAGObject |
checkAndResetMark,
checkMark,
clone,
controlAcquired,
controlLost,
getGameManager,
getInfluenceRange,
getObjectManager,
getPosition,
killed,
mark,
newerVersion,
setInfluenceRange,
setPosition |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public double weight
Constructor Detail |
public Item()
Method Detail |
public void init(java.lang.String gameName, java.lang.String objectName, double weight, java.lang.String type)
weight
- the weight (in kg) of the itemtype
- a String that denotes the kind of item (sword, apple, ring, ...)public java.lang.String getObjectName()
public java.lang.String getDescription()
public java.awt.Image getImage()
public MathVector getDimensions()
public boolean getVisible()
public void setVisible(boolean visible)
visible
- public boolean useWith(java.lang.String target)
target
- the object this Item is to be used withpublic void actionEvent(ObjectActionEvent event)
ObjectActionEvent
s that the ObjectManager
receives for this object.event
- the event, that took placeObjectActionEvent
public void draw(DrawManager drawManager)
drawManager
- an instance of the responisble DrawManagerDrawManager
public boolean isItemUsableBy(java.lang.String owner)
owner
- the suspected user of the Item (should always be none)public MathVector checkCollision(java.lang.String other, MathVector oldPos, MathVector delta)
other
- the object, causing a possible collision with this itemFRAGObject.checkCollision(java.lang.String, org.globalse.arena.frag.util.MathVector, org.globalse.arena.frag.util.MathVector)
public double getCollisionSphere()
public java.lang.String getType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |