net.sf.freecol.server.model
Class ServerRegion
java.lang.Object
net.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.FreeColGameObject
net.sf.freecol.common.model.Region
net.sf.freecol.server.model.ServerRegion
- All Implemented Interfaces:
- Nameable
public class ServerRegion
- extends Region
|
Field Summary |
private java.awt.Rectangle |
bounds
A Rectangle that contains all points of the Region. |
private int |
size
The size of this Region (number of Tiles). |
|
Method Summary |
void |
addTile(Tile tile)
Add the given Tile to this Region. |
java.awt.Rectangle |
getBounds()
Get the Bounds value. |
Map.Position |
getCenter()
Return the center of the Region's bounding box. |
int |
getSize()
Get the Size value. |
void |
setBounds(java.awt.Rectangle newBounds)
Set the Bounds value. |
void |
setSize(int newSize)
Set the Size value. |
| Methods inherited from class net.sf.freecol.common.model.Region |
addChild, discover, getChildren, getDiscoverableRegion, getDiscoveredBy, getDiscoveredIn, getLabel, getName, getNameKey, getParent, getScoreValue, getType, getTypeNameKey, getXMLElementTagName, isClaimable, isDiscoverable, isLeaf, isPacific, isPrediscovered, isRoot, readFromXMLImpl, setChildren, setClaimable, setDiscoverable, setDiscoveredBy, setDiscoveredIn, setName, setNameKey, setParent, setPrediscovered, setScoreValue, setType, toString, toXMLImpl |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObject |
dispose, disposeList, equals, equals, fundamentalDispose, getFreeColGameObject, getFreeColGameObject, getGame, getIntegerID, getSpecification, hashCode, isDisposed, isUninitialized, newLocation, readFromXML, readFromXMLPartialByClass, setDefaultId, setGame, setId, toXML, toXMLImpl, toXMLPartialByClass, updateFreeColGameObject |
| Methods inherited from class net.sf.freecol.common.model.FreeColObject |
addPropertyChangeListener, addPropertyChangeListener, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readAttributes, readChild, readChild, readChildren, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXMLElement, readFromXMLImpl, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setSpecification, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
size
private int size
- The size of this Region (number of Tiles).
bounds
private java.awt.Rectangle bounds
- A Rectangle that contains all points of the Region.
ServerRegion
public ServerRegion(Game game,
java.lang.String nameKey,
Region.RegionType type)
ServerRegion
public ServerRegion(Game game,
java.lang.String nameKey,
Region.RegionType type,
Region parent)
getSize
public final int getSize()
- Get the
Size value.
- Returns:
- an
int value
setSize
public final void setSize(int newSize)
- Set the
Size value.
- Parameters:
newSize - The new Size value.
getBounds
public final java.awt.Rectangle getBounds()
- Get the
Bounds value.
- Returns:
- a
Rectangle value
setBounds
public final void setBounds(java.awt.Rectangle newBounds)
- Set the
Bounds value.
- Parameters:
newBounds - The new Bounds value.
addTile
public void addTile(Tile tile)
- Add the given Tile to this Region.
- Parameters:
tile - a Tile value
getCenter
public Map.Position getCenter()
- Return the center of the Region's bounding box.
- Returns:
- a
Position value