us.asciiroth.client.core
Interface Item

All Superinterfaces:
Piece
All Known Implementing Classes:
AbstractItem, Agentray, AmmoBow, AmmoGun, AmmoParalyzer, AmmoSling, Apple, Arrow, BlueRing, Bomb, Bone, Bow, Bread, Bullet, Chalice, Chalk, CopperPill, Crowbar, Crystal, Dagger, EmptyHanded, EuclideanShard, Fireball, Fish, FishingPole, GlassEye, GoldCoin, GoldenHarp, Grenade, Gun, Hammer, Head, Healer, HelmOfTheAsciiroth, KelpSmoothie, Key, Kiwi, MirrorShield, Mushroom, Parabullet, Paralyzer, PeachElixir, PoisonDart, ProteinBar, PurpleMushroom, RedRing, Rock, Scroll, SilverAnkh, Sling, SlingRock, Stoneray, Sword, TerminusEst, Weakray

public interface Item
extends Piece

Items are objects that can be picked up, moved, thrown and/or used by the player. They do not block movement into a cell.


Method Summary
 java.lang.String getDefiniteNoun(java.lang.String phrase)
          Produce the phrase with the {0} token replaced with the name of this item using a definite article.
 java.lang.String getIndefiniteNoun(java.lang.String phrase)
          Produce the phrase with the {0} token replaced with the name of this item using an indefinite article.
 void onDeselect(Event event, Cell cell)
          Notification that the user is trying to deselect the item.
 void onDrop(Event event, Cell cell)
          Notification that the item is about to be dropped.
 Item onFire(Event event)
          If this item can fire any kind of projectile, it should return it when this method is executed.
 void onHit(Event event, Cell agentLoc, Agent agent)
          Item has touched an agent either as a result of being thrown against the agent, or as a result of the player walking into the agent while holding the item.
 void onSelect(Context context, Cell cell)
          Notification that the user is trying to select the item.
 void onSteppedOn(Event event, Cell agentLoc, Agent agent)
          Notification that an agent has entered the same square as this item.
 void onThrow(Event event, Cell cell)
          Notification that the item is about to be thrown.
 void onThrowEnd(Event event, Cell cell)
          Notification that this item, having been thrown, has fallen to the ground at the indicated cell.
 void onUse(Event event)
          The player has used the item without indicating any particular direction for use.
 
Methods inherited from interface us.asciiroth.client.core.Piece
getColor, getName, getSymbol, is, not
 

Method Detail

getDefiniteNoun

java.lang.String getDefiniteNoun(java.lang.String phrase)
Produce the phrase with the {0} token replaced with the name of this item using a definite article.

Parameters:
phrase -

getIndefiniteNoun

java.lang.String getIndefiniteNoun(java.lang.String phrase)
Produce the phrase with the {0} token replaced with the name of this item using an indefinite article.

Parameters:
phrase -

onDeselect

void onDeselect(Event event,
                Cell cell)
Notification that the user is trying to deselect the item. Cancelling the event prevents the item from being deselected.

Parameters:
event -
cell -

onDrop

void onDrop(Event event,
            Cell cell)
Notification that the item is about to be dropped. Cancelling the event at this time prevents the item from leaving the agent's possession (it cannot be dropped for some reason).

Parameters:
event -
cell -

onFire

Item onFire(Event event)
If this item can fire any kind of projectile, it should return it when this method is executed.

Parameters:
event -
Returns:
an item that is the ammunition for this item when fired.

onHit

void onHit(Event event,
           Cell agentLoc,
           Agent agent)
Item has touched an agent either as a result of being thrown against the agent, or as a result of the player walking into the agent while holding the item. Cancelling the event within this method has no effect.

Parameters:
event -
agentLoc -
agent -

onSelect

void onSelect(Context context,
              Cell cell)
Notification that the user is trying to select the item. Cancelling the event has no effect because it creates an odd game experience, but you can undertake work in this method if the item changes the environment

Parameters:
context -
cell -

onSteppedOn

void onSteppedOn(Event event,
                 Cell agentLoc,
                 Agent agent)
Notification that an agent has entered the same square as this item.

Parameters:
event -
agentLoc -
agent -

onThrow

void onThrow(Event event,
             Cell cell)
Notification that the item is about to be thrown. If the event is canceled at this time, the item will not be thrown and it stays in the possession of the agent.

Parameters:
event -
cell -

onThrowEnd

void onThrowEnd(Event event,
                Cell cell)
Notification that this item, having been thrown, has fallen to the ground at the indicated cell. If you cancel the event, the item will disappear from the board.

Parameters:
event -
cell -

onUse

void onUse(Event event)
The player has used the item without indicating any particular direction for use. Even if the item has no intrinsic use, it's helpful to cancel the event with a message explaining that the item requires a direction to be useful.

Parameters:
event -

0.7

2009 Alx Dark