public class ConnectorTile extends Object implements Tile, Serializable
Tile is used to handle interaction
with Connectors. If you walk onto this tile, you are moved
based on the Connector. This tile allows any number of
characters to occupy it so no one can block other's access. It also
ignores all interaction, so you can't collide with (fight) other
characters while on a connection point. This means that when you first
arrive somewhere, you're safe until you step off the connection point.| Constructor and Description |
|---|
ConnectorTile(int id,
Connector connector)
Creates an instance of
ConnectorTile. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCharacter(CharacterManager mgr)
Adds the given character to this tile if possible.
|
boolean |
addItem(Item item)
Always returns false, since you can't have items on this tile.
|
boolean |
canOccupy(CharacterManager mgr)
Always returns true, because connection points are, by definition,
spaces you can occupy.
|
int |
getID()
Returns the identifier for this tile.
|
int[] |
getIdStack()
Returns a stack of identifiers, specifying everything on this
Tile. |
LevelBoard.ActionResult |
getItem(CharacterManager characterManager)
This always fails, since no items are allowed on this tile.
|
boolean |
isPassable(CharacterManager mgr)
Always returns true, because connection points are, by definition,
passable.
|
LevelBoard.ActionResult |
moveTo(CharacterManager characterManager)
Test to move the given character to this tile.
|
boolean |
removeCharacter(CharacterManager mgr)
Removes the given character from this tile, if and only if this
character is already on this tile.
|
boolean |
removeItem(Item item)
Always returns false, since you can't have items on this tile.
|
public ConnectorTile(int id,
Connector connector)
ConnectorTile.id - the tile's identifierconnectorRef - a reference to the Connectorpublic int getID()
public boolean isPassable(CharacterManager mgr)
isPassable in interface Tilemgr - the manager for a characterpublic boolean canOccupy(CharacterManager mgr)
public int[] getIdStack()
Tile.getIdStack in interface Tilepublic boolean addCharacter(CharacterManager mgr)
addCharacter in interface TilemgrRef - the manager for a characterpublic boolean removeCharacter(CharacterManager mgr)
removeCharacter in interface TilemgrRef - the manager for a characterpublic boolean addItem(Item item)
public boolean removeItem(Item item)
removeItem in interface TileitemRef - the manager for the itempublic LevelBoard.ActionResult moveTo(CharacterManager characterManager)
Connector, but since Connector can choose
whether or not to allow characters to enter (eg, look at
PlayerConnector), this isn't always true.public LevelBoard.ActionResult getItem(CharacterManager characterManager)
Copyright © 2013. All Rights Reserved.