net.sf.freecol.server.model
Class ServerIndianSettlement

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.GoodsLocation
                  extended by net.sf.freecol.common.model.Settlement
                      extended by net.sf.freecol.common.model.IndianSettlement
                          extended by net.sf.freecol.server.model.ServerIndianSettlement
All Implemented Interfaces:
Location, Named, Ownable, ServerModelObject

public class ServerIndianSettlement
extends IndianSettlement
implements ServerModelObject

The server version of an Indian Settlement.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation
UnitLocation.NoAddReason
 
Field Summary
private static java.util.logging.Logger logger
           
static int MAX_HORSES_PER_TURN
           
 
Fields inherited from class net.sf.freecol.common.model.IndianSettlement
ALARM_TAG_NAME, convertProgress, GOODS_BASE_PRICE, IS_VISITED_TAG_NAME, KEEP_RAW_MATERIAL, lastTribute, learnableSkill, missionary, MISSIONARY_TAG_NAME, OWNED_UNITS_TAG_NAME, ownedUnits, spokenTo, TALES_RADIUS, TRADE_MINIMUM_PRICE, TRADE_MINIMUM_SIZE, WANTED_GOODS_TAG_NAME, wantedGoods
 
Fields inherited from class net.sf.freecol.common.model.Settlement
FOOD_PER_COLONIST, owner, tile
 
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
ServerIndianSettlement(Game game, Player owner, java.lang.String name, Tile tile, boolean isCapital, UnitType learnableSkill, java.util.Set<Player> spokenTo, Unit missionary)
          Creates a new ServerIndianSettlement.
ServerIndianSettlement(Game game, java.lang.String id)
          Trivial constructor for all ServerModelObjects.
 
Method Summary
private  void consumeGoods(GoodsType type, int amount)
          Convenience function to remove an amount of goods.
 void csNewTurn(java.util.Random random, ChangeSet cs)
          New turn for this native settlement.
 java.lang.String getServerXMLElementTagName()
          Returns the tag name of the root element representing this object.
 java.util.List<FreeColGameObject> modifyAlarm(Player player, int addToAlarm)
          Modifies the alarm level towards the given player due to an event at this settlement, and propagate the alarm upwards through the tribe.
 
Methods inherited from class net.sf.freecol.common.model.IndianSettlement
add, addOwnedUnit, allowContact, changeAlarm, changeMissionary, checkForNewMissionaryConvert, disposeList, getAlarm, getAlarmLevelMessageId, getConvertProgress, getDefendingUnit, getGoodsCapacity, getImageKey, getLastTribute, getLearnableSkill, getLocationName, getLocationNameFor, getMaximumProduction, getMissionary, getMissionary, getNameFor, getOwnedUnits, getOwnedUnitsIterator, getPlunderRange, getPriceToBuy, getPriceToBuy, getPriceToSell, getPriceToSell, getProductionOf, getSellGoods, getShortAlarmLevelMessageId, getSoL, getWantedGoods, getWantedGoodsAmount, getXMLElementTagName, hasContactedSettlement, hasSpokenToChief, hasSpokenToChief, makeContactSettlement, propagateAlarm, readAttributes, readChild, readChildren, readFromXMLPartialImpl, removeAlarm, removeOwnedUnit, setAlarm, setConvertProgress, setLastTribute, setLearnableSkill, setMissionary, setSpokenToChief, setWantedGoods, toString, toXMLImpl, toXMLPartialImpl, tradeGoodsWithSetlement, updateWantedGoods, willSell, writeChildren
 
Methods inherited from class net.sf.freecol.common.model.Settlement
addTile, canBuildEquipment, canProvideEquipment, canProvideEquipment, changeOwner, getConsumptionOf, getConsumptionOf, getFeatureContainer, getFoodConsumption, getLineOfSight, getModifierSet, getName, getNameKey, getOwnedTiles, getOwner, getPlunder, getRadius, getSettlement, getTile, getType, isCapital, isConnected, placeSettlement, removeTile, setCapital, setFeatureContainer, setName, setOwner, setType, writeAttributes
 
Methods inherited from class net.sf.freecol.common.model.GoodsLocation
addGoods, addGoods, contains, dispose, getCompactGoods, getGoodsContainer, getGoodsCount, getGoodsIterator, getNoAddReason, getWarehouseCapacity, remove, removeGoods, removeGoods, removeGoods, setGoodsContainer
 
Methods inherited from class net.sf.freecol.common.model.UnitLocation
canAdd, getColony, getSpaceTaken, getUnitCapacity, getUnitCount, getUnitIterator, getUnitList, isEmpty, isFull
 
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, hasAbility, hasAttribute, hasListeners, readAttributes, readChild, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXMLElement, readFromXMLImpl, 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

MAX_HORSES_PER_TURN

public static final int MAX_HORSES_PER_TURN
See Also:
Constant Field Values
Constructor Detail

ServerIndianSettlement

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


ServerIndianSettlement

public ServerIndianSettlement(Game game,
                              Player owner,
                              java.lang.String name,
                              Tile tile,
                              boolean isCapital,
                              UnitType learnableSkill,
                              java.util.Set<Player> spokenTo,
                              Unit missionary)
Creates a new ServerIndianSettlement.

Parameters:
game - The Game in which this object belong.
owner - The Player owning this settlement.
name - The name for this settlement.
tile - The location of the IndianSettlement.
isCapital - True if settlement is tribe's capital
learnableSkill - The skill that can be learned by Europeans at this settlement.
spokenTo - Indicates if any European scout has asked to speak with the chief.
missionary - The missionary in this settlement (or null).
Throws:
java.lang.IllegalArgumentException - if an invalid tribe or kind is given
Method Detail

csNewTurn

public void csNewTurn(java.util.Random random,
                      ChangeSet cs)
New turn for this native settlement.

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

consumeGoods

private void consumeGoods(GoodsType type,
                          int amount)
Convenience function to remove an amount of goods.

Parameters:
type - The GoodsType to remove.
amount - The amount of goods to remove.

modifyAlarm

public java.util.List<FreeColGameObject> modifyAlarm(Player player,
                                                     int addToAlarm)
Modifies the alarm level towards the given player due to an event at this settlement, and propagate the alarm upwards through the tribe.

Parameters:
player - The Player.
addToAlarm - The amount to add to the current alarm level.
Returns:
A list of settlements whose alarm level has changed.

getServerXMLElementTagName

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

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