|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.server.generator.River
public class River
A river for the map generator.
Constructor Summary | |
---|---|
River(Map map,
java.util.Map<Map.Position,River> riverMap,
ServerRegion region,
java.util.Random random)
Constructor. |
Method Summary | |
---|---|
void |
add(Map.Position position,
Map.Direction direction)
Adds a new section to this river. |
boolean |
contains(Map.Position p)
Returns true if this river already contains the given position. |
boolean |
flowFromSource(Map.Position position)
Creates a river flowing from the given position if possible. |
RiverSection |
getLastSection()
|
int |
getLength()
Returns the length of this river. |
ServerRegion |
getRegion()
Get the ServerRegion value. |
java.util.List<RiverSection> |
getSections()
|
void |
grow(RiverSection lastSection,
Map.Position position)
Increases the size of this river. |
boolean |
isNextToSelf(Map.Position p)
Returns true if the given position is next to this river. |
boolean |
isNextToWater(Map.Position p)
Returns true if the given position is next to a river, lake or sea. |
void |
setRegion(ServerRegion newServerRegion)
Set the ServerRegion value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public River(Map map, java.util.Map<Map.Position,River> riverMap, ServerRegion region, java.util.Random random)
map
- The map on which the river flows.riverMap
- A hashtable of position-river pairs.region
- The region for this river.random
- The Random
number source to use.Method Detail |
---|
public java.util.List<RiverSection> getSections()
public int getLength()
public RiverSection getLastSection()
public final ServerRegion getRegion()
ServerRegion
value.
ServerRegion
valuepublic final void setRegion(ServerRegion newServerRegion)
ServerRegion
value.
newServerRegion
- The new ServerRegion value.public void add(Map.Position position, Map.Direction direction)
position
- Where this section is located.direction
- The direction the river is flowing in.public void grow(RiverSection lastSection, Map.Position position)
lastSection
- The last section of the river flowing into this one.position
- The position of the confluence.public boolean isNextToSelf(Map.Position p)
p
- A map position.
public boolean isNextToWater(Map.Position p)
p
- A map position.
public boolean contains(Map.Position p)
p
- A map position.
public boolean flowFromSource(Map.Position position)
position
- A map position.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |