|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.classes.magic.SpellProxy
This proxy class allows spells to be readied, like wands or range weapons. The proxy knows the name of the spell that's readied, and instantiates/starts the spell when the agent fires it.
Constructor Summary | |
SpellProxy(Commandable agent,
java.lang.String spellname)
Constructs a new SpellProxy |
Method Summary | |
boolean |
canReady(Commandable agent)
Checks if the specified Commandable may ready the object. |
boolean |
canUnready(Commandable agent)
Checks whether the specified agent may unready the object, assuming they've already got it readied. |
void |
fireDirection(Commandable agent,
int dir)
Tells the spell to fire itself in the specified direction. |
void |
fireLocation(Commandable agent,
Point target)
Tells the object to fire itself along the line specified from the agent to a destination point. |
java.lang.String |
getSpellName()
Returns the name of the spell we're proxying. |
boolean |
isReadied()
Returns true if we think we're readied. |
void |
notifyReady(Commandable agent)
Notifies the Readyable object that the agent has readied it. |
void |
notifyUnready(Commandable agent)
Unreadies the object. |
java.lang.String |
toString()
Returns the name of the spell. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SpellProxy(Commandable agent, java.lang.String spellname)
spellname
- the spell to readyagent
- the agent readying the spellMethod Detail |
public boolean canReady(Commandable agent)
canReady
in interface Readyable
agent
- the Commandable trying to ready the object
public boolean canUnready(Commandable agent)
canUnready
in interface Readyable
agent
- the person who has the item readied
public void notifyReady(Commandable agent)
notifyReady
in interface Readyable
agent
- the agent using itpublic void notifyUnready(Commandable agent)
SpellProxy handler does nothing.
notifyUnready
in interface Readyable
agent
- the agent using the objectpublic boolean isReadied()
isReadied
in interface Readyable
public void fireDirection(Commandable agent, int dir)
fireDirection
in interface Targetable
agent
- the agent firing the objectdir
- a wyvern.lib.Direction cardinal directionpublic void fireLocation(Commandable agent, Point target)
fireLocation
in interface Targetable
agent
- the agent firing the objecttarget
- the destination point, perhaps chosen using
the mouse.public java.lang.String toString()
public java.lang.String getSpellName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |