Adventure at Umalu  22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
 All Classes Functions Variables Pages
Public Member Functions | List of all members
jade.core.Actor Class Referenceabstract
Inheritance diagram for jade.core.Actor:
jade.core.Messenger jade.gen.map.ItemGenerator rogue.creature.Creature rogue.creature.Monster rogue.creature.Player rogue.creature.Dragon rogue.creature.Dummy rogue.creature.Frog_poisonous rogue.creature.InvisibleZombie rogue.creature.Orc rogue.creature.Rat rogue.creature.Shadow rogue.creature.Slug_fat rogue.creature.Troll rogue.creature.Unbeliever rogue.creature.Zombie

Public Member Functions

 Actor (ColoredChar face)
 
abstract void act ()
 
ColoredChar face ()
 
World world ()
 
final boolean bound ()
 
final boolean bound (World world)
 
void setPos (int x, int y)
 
final void setPos (Coordinate coord)
 
final void move (int dx, int dy)
 
final void move (Coordinate delta)
 
final void move (Direction dir)
 
int x ()
 
int y ()
 
final Coordinate pos ()
 
boolean expired ()
 
void expire ()
 
void attach (Actor holder)
 
void detach ()
 
Actor holder ()
 
final boolean held ()
 
final boolean held (Actor holder)
 
final Collection< Actorholds ()
 
void setWorld (World world)
 
- Public Member Functions inherited from jade.core.Messenger
 Messenger ()
 
void appendMessage (String message)
 
Iterable< String > retrieveMessages ()
 
void aggregateMessages (Messenger messenger)
 
void filterMessages (Collection< Messenger > filter)
 
void clearMessages ()
 

Detailed Description

Represents anything on a Jade

World

that can perform an action (or be acted upon). This obviously includes things like the player, NPCs, and monsters. Not as obviously, an

can represent things like items, spells, doors and traps, or even abstract actions like timers and events. An

can be attached to one another in order to create other interesting effects. For example, an enchantment spell might be an effect

attached to an item

. A timer

could be attached to the spell which simple counts an appropriate amount of turns, then expires the spell

.

Constructor & Destructor Documentation

jade.core.Actor.Actor ( ColoredChar  face)

Constructs a new

with the given face.

Parameters
facethe face of the

Member Function Documentation

abstract void jade.core.Actor.act ( )
pure virtual

Performs the actions of this

. Normally this would be called by the

World

in the

tick()

method, which allows the

actions to be scheduled properly based on act order and

speed.

Implemented in rogue.creature.Player, rogue.creature.Rat, rogue.creature.Unbeliever, rogue.creature.Zombie, rogue.creature.Dragon, rogue.creature.Frog_poisonous, rogue.creature.Orc, rogue.creature.Shadow, rogue.creature.Slug_fat, jade.gen.map.ItemGenerator, rogue.creature.Troll, rogue.creature.InvisibleZombie, and rogue.creature.Dummy.

void jade.core.Actor.attach ( Actor  holder)

Attaches this

to another. Note that the

must not be currently held or bound to a

World

when calling this method. The position of this

will follow the holder, and the

will be bound to the holder's

World

. However, the

will not be placed on the

World

grid and will therefore not be accessible through

world.getActorAt()

or

world.getActorsAt()

.

Parameters
holderthe new holder of the
final boolean jade.core.Actor.bound ( )

Returns true if the

bound to a

World

. This is equivalent to calling

actor.world() != null

.

Returns
true if the bound to a
World
final boolean jade.core.Actor.bound ( World  world)

Returns true if the

is bound to the given

World

. This is equivalent to calling

actor.world() == world

.

Parameters
worldthe
World
being tested
Returns
true if the is bound to world
void jade.core.Actor.detach ( )

Detaches this

from its current holder. Note that the

must currently be held when calling this method. If the

is bound, it will be placed on the

World

at the current position of the holder.

void jade.core.Actor.expire ( )

Expires the

, or in other words, marks it for removal.

boolean jade.core.Actor.expired ( )

Returns true if the

is expired, or in other words, marked for removal.

Returns
true if the is expired
ColoredChar jade.core.Actor.face ( )

Returns the face of the

.

Returns
the face of the
final boolean jade.core.Actor.held ( )

Returns true if the

is currently held. This is equivalent to

actor.holder() != null

.

Returns
true if the is currently held
final boolean jade.core.Actor.held ( Actor  holder)

Returns true if the

is held by the specified

. This is equivalent to

actor.holder() == holder

.

Parameters
holderthe holder being tested
Returns
true if the is held by the specified holder
Actor jade.core.Actor.holder ( )

Returns the current holder of the

, or null if it is not held.

Returns
the current holder of the
final Collection<Actor> jade.core.Actor.holds ( )

Returns all the

currently being held by this one.

Returns
all the currently being held by this one
final void jade.core.Actor.move ( int  dx,
int  dy 
)

Moves the

by the specified amounts

Parameters
dxthe change x
dythe change y
final void jade.core.Actor.move ( Coordinate  delta)

Moves the

by the specified amount

Parameters
deltathe change in x and y
final void jade.core.Actor.move ( Direction  dir)

Moves the

one tile in the specified direction

Parameters
dirthe change in x and y
final Coordinate jade.core.Actor.pos ( )

Returns a copy of the current position of the

.

Returns
a copy of the current position of the .
void jade.core.Actor.setPos ( int  x,
int  y 
)

Sets the position of the

on its current

World

. The

must be bound and not held when this method is called.

Parameters
xthe new x position of the
ythe new y position of the
final void jade.core.Actor.setPos ( Coordinate  coord)

Sets the position of the

on its current

World

. The

must be bound and not held when this method is called.

Parameters
coordthe new position of the
World jade.core.Actor.world ( )

Returns the

World

the

is currently bound to, or null if the

is unbound.

Returns
the
World
the is currently bound to
int jade.core.Actor.x ( )

Returns the x location of the

.

Returns
the x location of the
int jade.core.Actor.y ( )

Returns the y location of the

.

Returns
the y location of the

The documentation for this class was generated from the following file: