us.asciiroth.client.core
Interface Terrain

All Superinterfaces:
Piece
All Known Implementing Classes:
AbstractTerrain, AgentDestroyer, AgentGate, Altar, BeachGrass, BeeHive, Boards, Bookshelf, Bridge, BubblingLava, BunchGrass, Bushes, CaveEntrance, ChalkedFloor, Chest, Cliff, Cloud, ColorRelay, Crate, Crevasse, Decorator, Dirt, Door, DualTerrain, EmptyChest, EnergyTrapContainer, Equipper, EuclideanEngine, EuclideanTransporter, Exchanger, FarthapodNest, Field, FishPool, Flagger, Floor, Flowers, ForceField, Forest, Fountain, Gate, Grass, Haystack, HighRocks, ImpassableCliffs, KeySwitch, Lava, LowRocks, Messenger, Mimic, Mud, Ocean, OpeningMarker, PieceCreator, Pier, Pit, PitTrap, PlayerGate, PoisonTrapContainer, PressurePlate, Pylon, PyramidWall, Raft, Reflector, ResistancesTrapContainer, Rubble, RustyGate, Sand, Scrub, SecretPassage, ShallowSwamp, ShallowWater, Shooter, Sign, Sky, StairsDown, StairsUp, Surf, Swamp, SwampGrass, Switch, TallGrass, Teleporter, Throne, Timer, TrapContainerBase, TrashPile, Trigger, TriggerIf, TriggerIfNot, TriggerOnce, TriggerOnceIf, TriggerOnceIfNot, TriggerOnceOnDrop, TriggerOnceOnPickup, Turnstile, Unequipper, Unflagger, Urn, VendingMachine, Wall, Water, Waterfall, Weeds, WinGame, WishingWell, WoodPiling

public interface Terrain
extends Piece

Terrain is a piece type that describes the behavior and appearance of a cell on the board. There is only one terrain piece per cell, although some terrain types nest other terrain pieces (actually this nesting can go several levels deep). Items and agents can be placed on terrain, and must move through terrain.


Method Summary
 boolean canEnter(Agent agent, Cell cell, Direction direction)
          Can the (non-player) agent enter this terrain? Without regard to side effects, this method should determine if the agent can actually move into the cell.
 boolean canExit(Agent agent, Cell cell, Direction direction)
          Can the (non-player) agent exit this terrain? Without regard to side effects, this method should determine if the agent can actually move into the cell.
 void onAdjacentTo(Context context, Cell cell)
          This terrain is adjacent to the player.
 void onAgentEnter(Event event, Agent agent, Cell cell, Direction dir)
           
 void onAgentExit(Event event, Agent agent, Cell cell, Direction dir)
           
 void onDrop(Event event, Cell itemLoc, Item item)
          Item is going to drop onto the terrain at this point.
 void onEnter(Event event, Player player, Cell cell, Direction dir)
          Agent attempting to leave the from cell, heading toward the to cell.
 void onExit(Event event, Player player, Cell cell, Direction dir)
          Agent attempting to exit the from cell, heading toward the to cell.
 void onFlyOver(Event event, Cell cell, InFlightItem flier)
          Terrain has an item flying over it.
 void onNotAdjacentTo(Context context, Cell cell)
          This terrain is no longer adjacent to the player.
 void onPickup(Event event, Cell loc, Agent agent, Item item)
          Item is going to be picked up.
 
Methods inherited from interface us.asciiroth.client.core.Piece
getColor, getName, getSymbol, is, not
 

Method Detail

canEnter

boolean canEnter(Agent agent,
                 Cell cell,
                 Direction direction)
Can the (non-player) agent enter this terrain? Without regard to side effects, this method should determine if the agent can actually move into the cell. Error on the side of caution and return false if the answer is ambiguous.

Parameters:
agent -
cell -
direction -
Returns:
true if the agent can enter the terrain moving between the two cells using the indicated direction
See Also:
Cell.canEnter(Cell, Agent, Direction, boolean)

canExit

boolean canExit(Agent agent,
                Cell cell,
                Direction direction)
Can the (non-player) agent exit this terrain? Without regard to side effects, this method should determine if the agent can actually move into the cell. Error on the side of caution and return false if the answer is ambiguous.

Parameters:
agent -
cell -
direction -
Returns:
true if the agent can leave this cell going in the indicated direction
See Also:
Cell.canEnter(Cell, Agent, Direction, boolean)

onAdjacentTo

void onAdjacentTo(Context context,
                  Cell cell)
This terrain is adjacent to the player. It may render differently under these circumstances.

Parameters:
context -
cell -

onAgentEnter

void onAgentEnter(Event event,
                  Agent agent,
                  Cell cell,
                  Direction dir)

onAgentExit

void onAgentExit(Event event,
                 Agent agent,
                 Cell cell,
                 Direction dir)

onDrop

void onDrop(Event event,
            Cell itemLoc,
            Item item)
Item is going to drop onto the terrain at this point. If the event if canceled at this point, then the item will simply disappear from the board.

Parameters:
event -
itemLoc -
item -

onEnter

void onEnter(Event event,
             Player player,
             Cell cell,
             Direction dir)
Agent attempting to leave the from cell, heading toward the to cell. The terrain being used is the terrain of the to cell. The agent is still in the from
Parameters:
event -
player -
cell -
dir -

onExit

void onExit(Event event,
            Player player,
            Cell cell,
            Direction dir)
Agent attempting to exit the from cell, heading toward the to cell. The terrain being used is the from cell terrain, and the agent is still in the from cell. If the event is canceled at this point, the agent will not be able leave this cell. The move will be canceled. This event is fired for the player as well as all other agents

Parameters:
event -
player -
cell -
dir -

onFlyOver

void onFlyOver(Event event,
               Cell cell,
               InFlightItem flier)
Terrain has an item flying over it. If the event is canceled at this point, the item will fall to the ground on this cell.

Parameters:
event -
cell -
flier -

onNotAdjacentTo

void onNotAdjacentTo(Context context,
                     Cell cell)
This terrain is no longer adjacent to the player. It may render differently under these circumstances.

Parameters:
context -
cell -

onPickup

void onPickup(Event event,
              Cell loc,
              Agent agent,
              Item item)
Item is going to be picked up. If the event is canceled at this point, the item will not be picked up and will remain on the cell.

Parameters:
event -
loc -
agent -
item -

0.7

© 2009 Alx Dark