|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.server.generator.RiverSection
public class RiverSection
This class facilitates building, editing the TileImprovement style for rivers Rivers on the Map are composed of many individual TileImprovements displayed on each Tile the river flows through The river TileImprovement on a Tile has a style which represents the inputs/outputs of water to/from neighboring Tiles This class allows manipulation of individual stream(s) to neighboring Tiles (there are many in case of confluence)
Field Summary | |
---|---|
Map.Direction |
direction
Direction the river is flowing toward, at the current section |
Constructor Summary | |
---|---|
RiverSection(int style)
Constructor used by the MapEditor to encode/decode the style |
|
RiverSection(Map.Position position,
Map.Direction direction)
Constructor used to automatically generate rivers. |
Method Summary | |
---|---|
void |
decodeStyle(int style)
Decodes the style |
int |
encodeStyle()
Encodes the style as a four-digit base-three number. |
int |
getBranch(Map.Direction direction)
Gets the size of a branch |
Map.Position |
getPosition()
Returns the position |
int |
getSize()
Returns the size |
void |
grow()
Increases the size of this section by one. |
void |
growBranch(Map.Direction direction,
int increment)
Increases the size a branch |
void |
removeBranch(Map.Direction direction)
Removes a branch |
void |
setBranch(Map.Direction direction,
int size)
Sets the size of a branch |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Map.Direction direction
Constructor Detail |
---|
public RiverSection(int style)
style
- The encoded stylepublic RiverSection(Map.Position position, Map.Direction direction)
position
- The map positiondirection
- The direction the river is flowing towardMethod Detail |
---|
public Map.Position getPosition()
public int getSize()
public void decodeStyle(int style)
style
- public int encodeStyle()
public void setBranch(Map.Direction direction, int size)
public int getBranch(Map.Direction direction)
public void removeBranch(Map.Direction direction)
public void growBranch(Map.Direction direction, int increment)
public void grow()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |