net.sf.freecol.server.model
Class ServerEurope

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObject
          extended by net.sf.freecol.common.model.UnitLocation
              extended by net.sf.freecol.common.model.Europe
                  extended by net.sf.freecol.server.model.ServerEurope
All Implemented Interfaces:
Location, Named, Ownable, ServerModelObject

public class ServerEurope
extends Europe
implements ServerModelObject

The server version of Europe.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.freecol.common.model.Europe
Europe.MigrationType
 
Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation
UnitLocation.NoAddReason
 
Field Summary
private static java.util.logging.Logger logger
           
 
Fields inherited from class net.sf.freecol.common.model.Europe
RECRUIT_COUNT, UNIT_CHANGE, unitPrices
 
Fields inherited from class net.sf.freecol.common.model.FreeColGameObject
UNITS_TAG_NAME
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG
 
Constructor Summary
ServerEurope(Game game, Player owner)
          Creates a new ServerEurope.
ServerEurope(Game game, java.lang.String id)
          Trivial constructor required for all ServerModelObjects.
 
Method Summary
 void csNewTurn(java.util.Random random, ChangeSet cs)
          New turn for this colony tile.
 java.lang.String getServerXMLElementTagName()
          Returns the tag name of the root element representing this object.
 void increasePrice(UnitType unitType, int price)
          Increases the price for a unit.
 void initializeMigration(java.util.Random random)
          Generates the initial recruits for this player.
 
Methods inherited from class net.sf.freecol.common.model.Europe
add, canAdd, canBuildEquipment, getFeatureContainer, getLocationName, getNameKey, getOwner, getRecruitable, getRecruitPrice, getUnitPrice, getXMLElementTagName, hasAbility, hasCarrierWithSpace, increaseRecruitmentDifficulty, readChild, readFromXMLImpl, readFromXMLPartialImpl, recruitablesDiffer, setFeatureContainer, setOwner, setRecruitable, toString, toXMLImpl, toXMLPartialImpl
 
Methods inherited from class net.sf.freecol.common.model.UnitLocation
contains, dispose, disposeList, getColony, getGoodsContainer, getLocationNameFor, getNoAddReason, getSettlement, getSpaceTaken, getTile, getUnitCapacity, getUnitCount, getUnitIterator, getUnitList, isEmpty, isFull, readChildren, remove, writeAttributes, writeChildren
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject
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, hasAttribute, hasListeners, readAttributes, readAttributes, readChild, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXMLElement, readFromXMLImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setSpecification, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeChildren
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.model.Location
getId
 

Field Detail

logger

private static final java.util.logging.Logger logger
Constructor Detail

ServerEurope

public ServerEurope(Game game,
                    java.lang.String id)
Trivial constructor required for all ServerModelObjects.


ServerEurope

public ServerEurope(Game game,
                    Player owner)
Creates a new ServerEurope.

Parameters:
game - The Game in which this object belong.
owner - The Player that will be using this object of Europe.
Method Detail

initializeMigration

public void initializeMigration(java.util.Random random)
Generates the initial recruits for this player. Recruits may be determined by the difficulty level, or generated randomly.

Parameters:
random - A pseudo-random number source.

increasePrice

public void increasePrice(UnitType unitType,
                          int price)
Increases the price for a unit.

Parameters:
unitType - The UnitType, trained or purchased
price - The current price of the unit

csNewTurn

public void csNewTurn(java.util.Random random,
                      ChangeSet cs)
New turn for this colony tile. TODO: give Europe a shipyard and remove this

Specified by:
csNewTurn in interface ServerModelObject
Parameters:
random - A Random number source.
cs - A ChangeSet to update.

getServerXMLElementTagName

public java.lang.String getServerXMLElementTagName()
Returns the tag name of the root element representing this object.

Specified by:
getServerXMLElementTagName in interface ServerModelObject
Returns:
"serverEurope"