Class Grid.Portal
raft.kilavuz.grid
java.lang.Object
  raft.kilavuz.grid.Grid.Portal
All Implemented Interfaces:
Enclosing class:

public class Grid.Portal
extends Object
implements Serializable
a portal is a line of (generally) border cells which leads to same sector with same action

Field Summary
short
action
action to take to pass through this portal.
direction
orientation of this portal.
fromSector
owner of this portal
int
id
id of this portal, assigned during creation
boolean
regular
if this portal is regular.
toSector
which sector this portal leads to
Method Summary
float[]
getBounds()
returns bounds as minX, maxX, minZ, maxZ
getCells()
returns an unmodifiable view of cells this portal consists of
getExplicitCost()
returns explicit cost or null if not set
getGrid()
returns enclosing grid instance
void
setExplicitCost(Float cost)
explicitly sets cost of passing through this portal.
toString()
returns a string representation of this portal
Field Detail
id
public final int id
id of this portal, assigned during creation

regular
public final boolean regular
if this portal is regular. a regular portal is a portal which is created during flood fill and leads to an adjacent sector

direction
public final Direction direction
orientation of this portal. null for non regular portals

action
public final short action
action to take to pass through this portal. Land.ACTION_NONE for regular portals

fromSector
public final Grid.Sector fromSector
owner of this portal

toSector
public final Grid.Sector toSector
which sector this portal leads to
Method Detail
getExplicitCost
public Float getExplicitCost()
returns explicit cost or null if not set

setExplicitCost
public void setExplicitCost(Float cost)
explicitly sets cost of passing through this portal. if an explicit cost is set, it has precedence over regular cost calculation. setting to null removes explicit cost information. explicit cost set on Grid.Portal is transferred to Land.Portal when the land is created

getCells
public Collection<Grid.CellgetCells()
returns an unmodifiable view of cells this portal consists of

getGrid
public Grid getGrid()
returns enclosing grid instance

getBounds
public float[] getBounds()
returns bounds as minX, maxX, minZ, maxZ

toString
public String toString()
returns a string representation of this portal
Overrides:
toString in class Object
Java API documentation generated with DocFlex/Doclet v1.5.2
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc. If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com