Package net.sf.freecol.server.model
Class ServerColonyTile
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Comparable<FreeColObject>
,Location
,Ownable
,ObjectWithId
,TurnTaker
public class ServerColonyTile extends ColonyTile implements TurnTaker
The server version of a colony tile.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.freecol.common.model.WorkLocation
WorkLocation.Suggestion
-
Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation
UnitLocation.NoAddReason
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
-
Fields inherited from class net.sf.freecol.common.model.ColonyTile
TAG, UNIT_CAPACITY, UNIT_CHANGE, workTile
-
Fields inherited from class net.sf.freecol.common.model.WorkLocation
colony, EMPTY_LIST
-
Fields inherited from class net.sf.freecol.common.model.FreeColGameObject
initialized
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
Fields inherited from interface net.sf.freecol.common.model.Location
LOCATION_RANK_EUROPE, LOCATION_RANK_HIGHSEAS, LOCATION_RANK_NOWHERE
-
-
Constructor Summary
Constructors Constructor Description ServerColonyTile(Game game, java.lang.String id)
Trivial constructor for Game.newInstance.ServerColonyTile(Game game, Colony colony, Tile workTile)
Creates at new ServerColonyTile.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
csNewTurn(java.util.Random random, LogBuilder lb, ChangeSet cs)
New turn for this colony tile.private Resource
expendResource(Tile tile, GoodsType goodsType, UnitType unitType)
This method is called only when a new turn is beginning.-
Methods inherited from class net.sf.freecol.common.model.ColonyTile
canAutoProduce, canProduce, copyIn, evaluateFor, getAvailableProductionTypes, getBaseProduction, getBasicProductionInfo, getClaimTemplate, getCompetenceFactor, getDisplayObject, getLabel, getLevel, getLocationLabel, getNoAddReason, getNoWorkReason, getOccupyingUnit, getProductionModifiers, getRebelFactor, getUnitCapacity, getWorkTile, getXMLTagName, goodSuggestionCheck, improvedBy, isAvailable, isColonyCenterTile, isCurrent, isOccupied, readAttributes, setWorkTile, toShortString, toString, up, writeAttributes
-
Methods inherited from class net.sf.freecol.common.model.WorkLocation
add, canBeWorked, canTeach, getBestProductionType, getColony, getCurrentWorkType, getExpertUnitType, getGenericPotential, getInputs, getLocationLabelFor, getMaximumProductionOf, getOccupation, getOccupation, getOutputs, getOwner, getPotentialProduction, getProduction, getProductionDeficit, getProductionInfo, getProductionOf, getProductionType, getRank, getSettlement, getSuggestions, getTile, getTotalProductionOf, getUnitProduction, getWorkFor, goodSuggestionCheck, hasInputs, hasOutputs, produces, readChild, remove, setColony, setOwner, setProductionType, setWorkFor, updateProductionType, writeChildren
-
Methods inherited from class net.sf.freecol.common.model.UnitLocation
canAdd, clearUnitList, contains, disposeResources, equipForRole, getCarrierForUnit, getDisposables, getFirstUnit, getGoodsContainer, getIndianSettlement, getLastUnit, getNavalUnits, getSpaceTaken, getTotalUnitCount, getUnitCount, getUnitList, getUnits, hasCarrierWithSpace, intern, isEmpty, isFull, moveToFront, priceGoods, readChildren
-
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject
checkIntegrity, dispose, equals, fundamentalDispose, getClassIndex, getGame, getLinkTarget, getSpecification, hashCode, internId, isDisposed, isInitialized, isInternable, readFromXML, setGame, setSpecification
-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getDefenceModifiers, getFeatureContainer, getFreeColObjectClass, getFreeColObjectClassByName, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSuffix, getSuffix, hasAbility, hasAbility, hasAbility, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, serialize, serialize, setId, toXML, toXML, toXMLPartial, toXMLPartial
-
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, getLocationImageKey
-
-
-
-
Constructor Detail
-
ServerColonyTile
public ServerColonyTile(Game game, java.lang.String id)
Trivial constructor for Game.newInstance.- Parameters:
game
- TheGame
this object belongs to.id
- The object identifier.
-
-
Method Detail
-
expendResource
private Resource expendResource(Tile tile, GoodsType goodsType, UnitType unitType)
This method is called only when a new turn is beginning. It will reduce the quantity of the bonusResource
that is on the given tile, if any and if applicable.- Parameters:
tile
- TheTile
to check for a resource.goodsType
- TheGoodsType
the goods type to expend.unitType
- TheUnitType
doing the production.- Returns:
- The
Resource
if it is exhausted by this call (so it can be used in a message), otherwise null.
-
csNewTurn
public void csNewTurn(java.util.Random random, LogBuilder lb, ChangeSet cs)
New turn for this colony tile.
-
-