wyvern.common.util
Class TerrainInfo

java.lang.Object
  extended bywyvern.common.util.TerrainInfo

public class TerrainInfo
extends java.lang.Object

This class is used by the Borderer code; it encapsulates all the information about a particular terrain object needed to be able to choose borders for it.

Version:
1.0, Jul 11, 1998
Author:
Steve Yegge

Constructor Summary
TerrainInfo()
          Constructs a new TerrainInfo with no parameters.
TerrainInfo(int tile, int priority, boolean letsIn, boolean letsOut, boolean borders)
          Constructs a new TerrainInfo with the specified parameters.
 
Method Summary
 boolean getLetsIn()
           
 boolean getLetsOut()
           
 int getPriority()
           
 int getTile()
           
 boolean hasBorders()
           
 void setBorders(boolean borders)
           
 void setLetsIn(boolean in)
           
 void setLetsOut(boolean out)
           
 void setPriority(int priority)
           
 void setTile(int tile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerrainInfo

public TerrainInfo(int tile,
                   int priority,
                   boolean letsIn,
                   boolean letsOut,
                   boolean borders)
Constructs a new TerrainInfo with the specified parameters.

Parameters:
tile - the database tile number of the terrain square.
priority - the terrain's priority number. For two adjacent terrain tiles, both of which have borders that can extend outwards, only one should actually extend borders. The priority scheme lets us choose the right one. Higher priorities extend borders over lower priorities. In general, a higher priority is used for "higher ground", so sea-level the lowest priority. For terrain of equal priorities, the one with the higher tile number gets to extend its borders. Priorities can be overridden on a location-by-location basis by using the letsIn and letsOut flags.
letsIn - false if this terrain square wants to prevent higher-priority neighbors from extending their borders into this square's location.
letsOut - false if the terrain type has borders, but this particular terrain square doesn't want to extend them out. It's still possible for a higher-priority terrain square to extend borders into the square if this flag is false.
borders - true if this terrain type terrain has border tiles.

TerrainInfo

public TerrainInfo()
Constructs a new TerrainInfo with no parameters. They must be set manually. The boolean flags default to true, and the priority defaults to zero.

Method Detail

setTile

public void setTile(int tile)

setPriority

public void setPriority(int priority)

setLetsIn

public void setLetsIn(boolean in)

setLetsOut

public void setLetsOut(boolean out)

setBorders

public void setBorders(boolean borders)

getTile

public int getTile()

getPriority

public int getPriority()

getLetsIn

public boolean getLetsIn()

getLetsOut

public boolean getLetsOut()

hasBorders

public boolean hasBorders()