Package net.sf.freecol.server.model
Class ServerPlayer
- java.lang.Object
- 
- net.sf.freecol.common.model.FreeColObject
- 
- net.sf.freecol.common.model.FreeColGameObject
- 
- net.sf.freecol.common.model.Player
- 
- net.sf.freecol.server.model.ServerPlayer
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<FreeColObject>,- Nameable,- ObjectWithId,- TurnTaker
 
 public class ServerPlayer extends Player implements TurnTaker APlayerwith additional (server specific) information, notably this player'sConnection.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classServerPlayer.DeadCheck- 
Nested classes/interfaces inherited from class net.sf.freecol.common.model.PlayerPlayer.ColonyValueCategory, Player.NoClaimReason, Player.NoValueType, Player.PlayerType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static intALARM_RADIUSstatic intALARM_TILE_IN_USEprivate ConnectionconnectionThe connection for this player.private java.util.List<AbstractGoods>extraTradesAccumulate extra trades here.private static java.util.logging.Loggerloggerprivate intremainingEmigrantsRemaining emigrants to select due to a fountain of youthstatic intSCORE_FOUNDING_FATHERstatic doubleSCORE_GOLDstatic intSCORE_INDEPENDENCE_BONUS_FIRSTstatic intSCORE_INDEPENDENCE_BONUS_SECONDstatic intSCORE_INDEPENDENCE_BONUS_THIRDstatic intSCORE_NATION_DESTROYEDstatic intSCORE_SETTLEMENT_DESTROYEDprivate java.util.List<Player>stanceDirtyPlayers with respect to which stance has changed.- 
Fields inherited from class net.sf.freecol.common.model.Playeradmin, ai, ASSIGN_SETTLEMENT_NAME, attackedByPrivateers, bannedMissions, currentFather, dead, entryTile, europe, featureContainer, foundingFathers, gold, GOLD_NOT_ACCOUNTED, highSeas, history, immigration, immigrationRequired, independentNationName, interventionBells, lastSales, liberty, market, modelMessages, monarch, name, nationId, nationType, newLandName, offeredFathers, oldSoL, playerComparator, playerType, ready, score, settlements, stance, TAG, tax, tension, tradeRoutes
 - 
Fields inherited from class net.sf.freecol.common.model.FreeColGameObjectinitialized
 - 
Fields inherited from class net.sf.freecol.common.model.FreeColObjectARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
 
- 
 - 
Constructor SummaryConstructors Constructor Description ServerPlayer(Game game, boolean admin, Nation nation)Creates a new ServerPlayer.ServerPlayer(Game game, java.lang.String id)Trivial constructor for Game.newInstance.ServerPlayer(Game game, Connection connection)Special constructor to make a simple stub player with only the connection information valid.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtraTrade(AbstractGoods ag)Accumulate extra trades.voidaddHistory(HistoryEvent event)Add a HistoryEvent to this player.private voidaddStanceChange(Player other)Adds a player to the list of players for whom the stance has changed.intbuyInEurope(java.util.Random random, GoodsContainer container, GoodsType type, int amount)Buy goods in Europe.booleancanRecruitFoundingFather()Checks whether to start recruiting a founding father.ServerPlayer.DeadCheckcheckForDeath()Checks if this player has died.private booleancheckForREFDefeat()Check if a REF player has been defeated and should surrender.private FoundingFathercheckFoundingFather()Checks whether the current founding father has been recruited.java.util.Set<Tile>collectNewTiles(java.util.Collection<Tile> collection)Given a tile and new radius of visibility, explore unexplored tiles and return those plus the previously invisible tiles.java.util.Set<Tile>collectNewTiles(java.util.stream.Stream<Tile> tiles)Given a stream of tiles, explore unexplored tiles and return those plus the previously invisible tiles.java.util.Set<Tile>collectNewTiles(Tile center, int radius)Given a tile and new radius of visibility, explore unexplored tiles and return those plus the previously invisible tiles.java.util.List<Unit>createUnits(java.util.List<AbstractUnit> abstractUnits, Location location, java.util.Random random)Create units from a list of abstract units.voidcsAddFoundingFather(FoundingFather father, java.util.Random random, ChangeSet cs)Adds a founding father to a players continental congress.voidcsAddMercenaries(java.util.List<AbstractUnit> mercs, int price, java.util.Random random, ChangeSet cs)Adds mercenaries that the player has accepted.java.util.List<ModelMessage>csApplyDisaster(java.util.Random random, Colony colony, Disaster disaster, ChangeSet cs)Apply the effects of the givenDisasterto the givenColony, or thePlayerif theColonyisnull, and return a list of appropriateModelMessages.private voidcsAutoequipUnit(Unit unit, Settlement settlement, ChangeSet cs)Notifies of automatic arming.private voidcsBombardEnemyShips(java.util.Random random, ChangeSet cs)All player colonies bombard all available targets.private voidcsBurnMissions(Unit attacker, IndianSettlement is, ChangeSet cs)Burns a players missions.private voidcsCaptureAutoEquip(Unit attacker, Unit defender, ChangeSet cs)Defender auto equips but loses and attacker captures the equipment.private voidcsCaptureColony(Unit attacker, ServerColony colony, java.util.Random random, ChangeSet cs)Captures a colony.private voidcsCaptureConvert(Unit attacker, IndianSettlement is, java.util.Random random, ChangeSet cs)Extracts a convert from a native settlement.private voidcsCaptureEquip(Unit winner, Unit loser, ChangeSet cs)Captures equipment.private voidcsCaptureEquipment(Unit winner, Unit loser, Role role, ChangeSet cs)Capture equipment.private voidcsCaptureUnit(Unit winner, Unit loser, ChangeSet cs)Capture a unit.booleancsChangeOwner(Unit unit, Player newOwner, java.lang.String change, Location loc, ChangeSet cs)Change the owner of a unit or dispose of it if the change is impossible.booleancsChangeStance(Stance stance, Player otherPlayer, boolean symmetric, ChangeSet cs)Modifies stance.voidcsClaimLand(Tile tile, Settlement settlement, int price, ChangeSet cs)Claim land.voidcsCombat(FreeColGameObject attacker, FreeColGameObject defender, java.util.List<CombatModel.CombatResult> crs, java.util.Random random, ChangeSet cs)Combat.voidcsCompleteNativeDemand(ServerPlayer demandPlayer, Unit unit, Colony colony, GoodsType type, int amount, Constants.IndianDemandAction result, ChangeSet cs)Accept the native demand at a players colony.booleancsContact(Player other, ChangeSet cs)Make contact between two nations if necessary.private voidcsDamageBuilding(Building building, ChangeSet cs)Damage a building in a colony by downgrading it if possible and destroying it otherwise.private voidcsDamageColonyShips(Unit attacker, Colony colony, ChangeSet cs)Damages all ships in a colony in preparation for capture.private voidcsDamageShip(Unit ship, Location repair, ChangeSet cs)Damage a ship.private voidcsDamageShipAttack(Unit attacker, Unit ship, ChangeSet cs)Damage a ship through normal attack.private voidcsDamageShipBombard(Settlement settlement, Unit ship, ChangeSet cs)Damage a ship through bombard.private voidcsDemoteUnit(Unit winner, Unit loser, ChangeSet cs)Demotes a unit.private voidcsDestroyColony(Unit attacker, Colony colony, java.util.Random random, ChangeSet cs)Destroy a colony.private voidcsDestroySettlement(Unit attacker, IndianSettlement is, java.util.Random random, ChangeSet cs)Destroys an Indian settlement.voidcsDiplomacy(DiplomacySession session, DiplomaticTrade agreement, ChangeSet cs)Process European diplomacy according to an agreement.voidcsDisposeSettlement(Settlement settlement, ChangeSet cs)Disposes of a settlement and reassign its tiles.voidcsEmigrate(int slot, Europe.MigrationType type, java.util.Random random, ChangeSet cs)A unit migrates from Europe.voidcsEndTurn(ChangeSet cs)Things to do just before ending the turn for a player.voidcsEuropeanFirstContact(Unit unit, Settlement settlement, Unit otherUnit, ChangeSet cs)Initiate first contact between this European and another European player.private voidcsEvadeAttack(Unit attacker, Unit defender, ChangeSet cs)Evade a normal attack.private voidcsEvadeBombard(Settlement settlement, Unit defender, ChangeSet cs)Evade a bombardment.booleancsFlushMarket(GoodsType type, ChangeSet cs)Flush any market price changes for a specified goods type.booleancsFlushMarket(ChangeSet cs)Flush any market price changes.private voidcsKill(ChangeSet cs)Kill off a player and clear out its remains.private voidcsLootShip(Unit winner, Unit loser, ChangeSet cs)Loot a ship.private voidcsLoseAutoEquip(Unit attacker, Unit defender, ChangeSet cs)Unit auto equips but loses equipment.private voidcsLoseEquip(Unit winner, Unit loser, ChangeSet cs)Unit drops some equipment.voidcsLoseLocation(Location loc, ChangeSet cs)Hook for when a player loses access to a location for whatever reason.voidcsMercenaries(int price, java.util.List<AbstractUnit> mercenaries, Monarch.MonarchAction action, java.util.Random random, ChangeSet cs)Add an independent (non-monarch) mercenary offer to the player.voidcsModifyTension(Player player, int add, Settlement origin, ChangeSet cs)Modifies the hostility against the given player.voidcsModifyTension(Player player, int add, ChangeSet cs)Modifies the hostility against the given player.voidcsNativeFirstContact(Player other, Tile tile, ChangeSet cs)Initiate first contact between this European and native player.private voidcsNaturalDisasters(java.util.Random random, ChangeSet cs, int probability)Check for natural disasters.voidcsNewTurn(java.util.Random random, LogBuilder lb, ChangeSet cs)New turn for this player.private voidcsPayUpkeep(java.util.Random random, ChangeSet cs)Pay upkeep on the player resources.private voidcsPillageColony(Unit attacker, Colony colony, java.util.Random random, ChangeSet cs)Damage a building or a ship or steal some goods or gold.private voidcsPromoteUnit(Unit winner, ChangeSet cs)Promotes a unit.voidcsRaiseTax(int tax, Goods goods, boolean accepted, ChangeSet cs)Raises the players tax rate, or handles a goods party.voidcsSeeNewTiles(java.util.Collection<? extends Tile> newTiles, ChangeSet cs)Updates the player view for each new tile on a supplied list, and update a ChangeSet as well.voidcsSetTax(int tax, ChangeSet cs)Set the player tax rate.private voidcsSinkColonyShips(Unit attacker, Colony colony, ChangeSet cs)Sinks all ships in a colony.private voidcsSinkShip(Unit ship, Player attackerPlayer, ChangeSet cs)Sink the ship.private voidcsSinkShipAttack(Unit attacker, Unit ship, ChangeSet cs)Sinks this ship as result of a normal attack.private voidcsSinkShipBombard(Settlement settlement, Unit ship, ChangeSet cs)Sinks this ship as result of a bombard.private voidcsSlaughterUnit(Unit winner, Unit loser, ChangeSet cs)Slaughter a unit.voidcsStartTurn(java.util.Random random, ChangeSet cs)Starts a new turn for a player.voidcsWithdraw(ChangeSet cs, ModelMessage mm, HistoryEvent he)Withdraw a player from the new world.voidcsYearlyGoodsAdjust(java.util.Random random, ChangeSet cs)Add or remove a standard yearly amount of storable goods, and a random extra amount of a random type.java.util.Set<Tile>exploreForSettlement(Settlement settlement)Sets the tiles visible to a given settlement to be explored by this player and updates the player's information about the tiles.java.util.Set<Tile>exploreForUnit(Unit unit)Sets the tiles within the givenUnit's line of sight to be explored by this player.java.util.Set<Tile>exploreMap(boolean reveal)Makes the entire map visible or invisible.booleanexploreTile(Tile tile)Sets the given tile to be explored by this player and updates the player's information about the tile.java.util.Set<Tile>exploreTiles(java.util.Collection<? extends Tile> tiles)Sets the tiles within the givenUnit's line of sight to be explored by this player.voidflushExtraTrades(java.util.Random random)Flush the extra trades.private BuildinggetBuildingForEffect(Colony colony, Effect effect, java.util.Random random)ConnectiongetConnection()Gets the connection of this player.java.util.List<BuildingType>getFreeBuildingTypes()Get a list of free building types this player has access to through its choice of founding fathers.private java.util.List<FoundingFather>getRandomFoundingFathers(java.util.Random random)Build a list of random FoundingFathers, one per type.intgetRemainingEmigrants()private intgetSlaughterTension(Unit loser)Gets the amount to raise tension by when a unit is slaughtered.private UnitgetUnitForEffect(Colony colony, Effect effect, java.util.Random random)booleanhasExplored(Tile tile)Checks if thisPlayerhas explored the givenTile.voidignoreMercenaries(ChangeSet cs)Handle the end of a session where the player has ignored an offer of mercenaries.voidignoreTax(int tax, Goods goods, ChangeSet cs)Handle the end of a session where the player has ignored a tax increase demand.voidinitialize(Game game, boolean admin, Nation nation)Complete initialization for this server player.java.util.List<Unit>loadShips(java.util.List<Unit> landUnits, java.util.List<Unit> navalUnits, java.util.Random random)Embark the land units.ModifiermakeTeaPartyModifier()Make a tea party modifier for the current turn.TradeRoutenewTradeRoute()Get a new trade route.voidpropagateToEuropeanMarkets(GoodsType type, int amount, java.util.Random random)Propagate an European market trade to the other European markets.voidrandomizeGame(java.util.Random random)Performs initial randomizations for this player.voidreassignTiles(java.util.Collection<Tile> tiles, Settlement avoid)Try to reassign the ownership of a collection of tiles, preferring this player.intsellInEurope(java.util.Random random, GoodsContainer container, GoodsType type, int amount)Sell goods in Europe.booleansend(ChangeSet cs)Send a change set across the connection.voidsetConnection(Connection connection)Sets the connection of this player.voidsetRemainingEmigrants(int emigrants)java.lang.StringtoString()voidupdateCurrentFather(FoundingFather ff)Update the current father.private booleanupdateScore()Update the current score for this player.- 
Methods inherited from class net.sf.freecol.common.model.PlayeraddFather, addLastSale, addMissionBan, addModelMessage, addOwnable, addSettlement, addStartGameMessage, addTradeRoute, addUnit, atWarWith, calculateStrength, canAcquireForImprovement, canBuildColonies, canClaimForImprovement, canClaimForSettlement, canClaimForSettlementReason, canClaimToFoundSettlement, canClaimToFoundSettlementReason, canHaveFoundingFathers, canMoveToEurope, canOwnTile, canSee, canSeeUnit, canTrade, canTrade, changeNationType, changePlayerType, checkDeclareIndependence, checkEmigrate, checkGold, checkIntegrity, clearModelMessages, clearNationCache, clearNationSummary, clearOfferedFathers, clientError, clientError, copyIn, divertModelMessages, getAllColonyValues, getArrears, getAttackedByPrivateers, getBankrupt, getBannedMissions, getCapitalName, getCarriersForUnit, getClaimableTiles, getClassIndex, getClosestPortForEurope, getColonies, getColoniesPopulation, getColonyByName, getColonyList, getColonyValue, getConnectedPortList, getConnectedPorts, getCountryLabel, getCurrentFather, getDead, getDebugName, getDisplayObject, getElectionTurns, getEmigrationMessage, getEntryTile, getEurope, getEuropeanPurchasePrice, getEuropeanRecruitPrice, getEuropeNameKey, getFallbackTile, getFatherCount, getFeatureContainer, getForcesLabel, getFoundingFathers, getGold, getHighSeas, getHistory, getImmigration, getImmigrationRequired, getIncomeAfterTaxes, getIncomeBeforeTaxes, getIndependentNationName, getIndianSettlementByName, getIndianSettlementList, getIndianSettlements, getIndianSettlementsWithMissionary, getIndianSettlementsWithMissionaryList, getInterventionBells, getLabel, getLandPrice, getLastSale, getLastSales, getLastSaleString, getLastSaleTip, getLiberty, getLibertyProductionNextTurn, getMarket, getMarketName, getMaximumFoodConsumption, getMercenaryHirePrice, getMilitaryUnits, getModelMessages, getMonarch, getMostValuableGoods, getName, getNameForNewLand, getNameForRegion, getNameForTradeRoute, getNameForUnit, getNation, getNationColor, getNationId, getNationLabel, getNationResourceKey, getNationSummary, getNationType, getNewestTradeRoute, getNewLandName, getNewModelMessages, getNextActiveUnit, getNextGoingToUnit, getNumberOfKingLandUnits, getNumberOfPorts, getOfferedFathers, getOldSoL, getOurFreeColGameObject, getPlayerType, getRank, getReady, getRebels, getRebelStrengthRatio, getREFPlayer, getREFUnits, getRemainingFoundingFatherCost, getRulerNameKey, getSales, getScore, getSettlementByName, getSettlementCount, getSettlementList, getSettlementName, getSettlements, getSoL, getSortedColonies, getSpanishSuccessionScore, getStance, getStances, getStrengthRatio, getTax, getTension, getTension, getTotalFoundingFatherCost, getTotalImmigrationProduction, getTradeRouteByName, getTradeRouteCount, getTradeRoutes, getUnitByName, getUnitCount, getUnitCount, getUnits, getUnitSet, getVisibleTileSet, getWaitingLabel, getXMLTagName, hasContacted, hasContactedEuropeans, hasContactedIndians, hasFather, hasNextActiveUnit, hasNextGoingToUnit, hasSettlement, hasSettlements, hasTraded, hasUnit, hasUnitType, initializeHighSeas, invalidateCanSeeTiles, isAdmin, isAI, isAtWar, isColonial, isConnected, isDead, isEuropean, isIndian, isNewLandNamed, isPotentialEnemy, isPotentialFriend, isReady, isRebel, isREF, isUndead, isUnknownEnemy, isWorkForREF, logCheat, makeContact, missionsBanned, modifyGold, modifyImmigration, modifyIncomeAfterTaxes, modifyIncomeBeforeTaxes, modifyLiberty, modifySales, owns, putNationSummary, putSettlementName, readAttributes, readChild, readChildren, recalculateBellsBonus, reduceImmigration, refilterModelMessages, reinitialiseMarket, removeDisplayedModelMessages, removeMissionBan, removeOwnable, removeSettlement, removeTension, removeTradeRoute, removeUnit, resetIterators, restoreActiveUnit, setAI, setAttackedByPrivateers, setBankrupt, setBannedMissions, setColonyComparator, setCurrentFather, setDead, setEntryTile, setEurope, setFoundingFathers, setGold, setHistory, setImmigration, setImmigrationRequired, setIndependentNationName, setLastSales, setLiberty, setModelMessages, setMonarch, setName, setNation, setNationType, setNewLandName, setNextGoingToUnit, setOfferedFathers, setReady, setScore, setStance, setStances, setTax, setTension, setTension, strengthRatio, updateImmigrationRequired, writeAttributes, writeChildren
 - 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectdispose, disposeResources, equals, fundamentalDispose, getDisposables, getGame, getLinkTarget, getSpecification, hashCode, intern, internId, isDisposed, isInitialized, isInternable, readFromXML, setGame, setSpecification
 - 
Methods inherited from class net.sf.freecol.common.model.FreeColObjectaddAbility, 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, 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
 
- 
 
- 
- 
- 
Field Detail- 
loggerprivate static final java.util.logging.Logger logger 
 - 
ALARM_RADIUSpublic static final int ALARM_RADIUS - See Also:
- Constant Field Values
 
 - 
ALARM_TILE_IN_USEpublic static final int ALARM_TILE_IN_USE - See Also:
- Constant Field Values
 
 - 
SCORE_SETTLEMENT_DESTROYEDpublic static final int SCORE_SETTLEMENT_DESTROYED - See Also:
- Constant Field Values
 
 - 
SCORE_NATION_DESTROYEDpublic static final int SCORE_NATION_DESTROYED - See Also:
- Constant Field Values
 
 - 
SCORE_GOLDpublic static final double SCORE_GOLD - See Also:
- Constant Field Values
 
 - 
SCORE_FOUNDING_FATHERpublic static final int SCORE_FOUNDING_FATHER - See Also:
- Constant Field Values
 
 - 
SCORE_INDEPENDENCE_BONUS_FIRSTpublic static final int SCORE_INDEPENDENCE_BONUS_FIRST - See Also:
- Constant Field Values
 
 - 
SCORE_INDEPENDENCE_BONUS_SECONDpublic static final int SCORE_INDEPENDENCE_BONUS_SECOND - See Also:
- Constant Field Values
 
 - 
SCORE_INDEPENDENCE_BONUS_THIRDpublic static final int SCORE_INDEPENDENCE_BONUS_THIRD - See Also:
- Constant Field Values
 
 - 
connectionprivate Connection connection The connection for this player.
 - 
remainingEmigrantsprivate int remainingEmigrants Remaining emigrants to select due to a fountain of youth
 - 
stanceDirtyprivate final java.util.List<Player> stanceDirty Players with respect to which stance has changed.
 - 
extraTradesprivate final java.util.List<AbstractGoods> extraTrades Accumulate extra trades here.
 
- 
 - 
Constructor Detail- 
ServerPlayerpublic ServerPlayer(Game game, java.lang.String id) Trivial constructor for Game.newInstance.- Parameters:
- game- The- Gamethis object belongs to.
- id- The object identifier.
 
 - 
ServerPlayerpublic ServerPlayer(Game game, Connection connection) Special constructor to make a simple stub player with only the connection information valid. Needed when a new player logs in.- Parameters:
- game- The- Gamethis player belongs to.
- connection- The initial- Connection.
 
 
- 
 - 
Method Detail- 
initializepublic final void initialize(Game game, boolean admin, Nation nation) Complete initialization for this server player. Used above and for the stub players created at login.- Parameters:
- game- The- Gamethis object belongs to.
- admin- Whether the player is the game administrator or not.
- nation- The nation for this player.
 
 - 
getConnectionpublic final Connection getConnection() Gets the connection of this player.- Overrides:
- getConnectionin class- Player
- Returns:
- The Connection.
 
 - 
setConnectionpublic final void setConnection(Connection connection) Sets the connection of this player.- Overrides:
- setConnectionin class- Player
- Parameters:
- connection- The- Connection.
 
 - 
sendpublic boolean send(ChangeSet cs) Send a change set across the connection.
 - 
updateCurrentFatherpublic void updateCurrentFather(FoundingFather ff) Update the current father.- Parameters:
- ff- The- FoundingFatherto recruit.
 
 - 
newTradeRoutepublic TradeRoute newTradeRoute() Get a new trade route.- Returns:
- The new TradeRoute.
 
 - 
addExtraTradepublic void addExtraTrade(AbstractGoods ag) Accumulate extra trades.- Parameters:
- ag- The- AbstractGoodsdescribing the sale.
 
 - 
flushExtraTradespublic void flushExtraTrades(java.util.Random random) Flush the extra trades.- Parameters:
- random- A pseudo-random number source.
 
 - 
randomizeGamepublic void randomizeGame(java.util.Random random) Performs initial randomizations for this player.- Parameters:
- random- A pseudo-random number source.
 
 - 
checkForDeathpublic ServerPlayer.DeadCheck checkForDeath() Checks if this player has died.- Returns:
- The appropriate DeadCheckvalue.
 
 - 
checkForREFDefeatprivate boolean checkForREFDefeat() Check if a REF player has been defeated and should surrender.- Returns:
- True if this REF player has been defeated.
 
 - 
csKillprivate void csKill(ChangeSet cs) Kill off a player and clear out its remains. +vis: Albeit killing the player makes visibility changes moot. +til: Fixes the appearance changes too.- Parameters:
- cs- A- ChangeSetto update.
 
 - 
csWithdrawpublic void csWithdraw(ChangeSet cs, ModelMessage mm, HistoryEvent he) Withdraw a player from the new world. Called from the standard endTurn processing when a player is found to have died, and from the Spanish Succession routine.- Parameters:
- mm- A- ModelMessageexplaining why the player is leaving, or null if the standard death message should be used.
- he- A corresponding- HistoryEvent, or null if the standard death message should be used.
- cs- A- ChangeSetto update.
 
 - 
getRemainingEmigrantspublic int getRemainingEmigrants() 
 - 
setRemainingEmigrantspublic void setRemainingEmigrants(int emigrants) 
 - 
checkFoundingFatherprivate FoundingFather checkFoundingFather() Checks whether the current founding father has been recruited.- Returns:
- The new founding father, or null if none available or ready.
 
 - 
canRecruitFoundingFatherpublic boolean canRecruitFoundingFather() Checks whether to start recruiting a founding father.- Returns:
- True if a new father should be chosen.
 
 - 
getRandomFoundingFathersprivate java.util.List<FoundingFather> getRandomFoundingFathers(java.util.Random random) Build a list of random FoundingFathers, one per type. Do not include any the player has or are not available.- Parameters:
- random- A pseudo-random number source.
- Returns:
- A list of FoundingFathers.
 
 - 
addHistorypublic void addHistory(HistoryEvent event) Add a HistoryEvent to this player.- Overrides:
- addHistoryin class- Player
- Parameters:
- event- The- HistoryEventto add.
 
 - 
updateScoreprivate boolean updateScore() Update the current score for this player. Known incompatibility with the Col1 manual: ``In addition, you get one point per liberty bell produced after foreign intervention'' However you are already getting a point per liberty bell produced, so this implies you get no further liberty after declaring independence!?, but it can then start again if the foreign intervention happens (penalizing players who quickly thrash the REF:-S). Whatever this really means, it is incompatible with our extensions to allow playing on (and defeating other Europeans), so for now at least just leave the simple liberty==score rule in place.- Returns:
- True if the player score changed.
 
 - 
hasExploredpublic boolean hasExplored(Tile tile) Checks if thisPlayerhas explored the givenTile.- Overrides:
- hasExploredin class- Player
- Parameters:
- tile- The- Tile.
- Returns:
- true if the Tilehas been explored and false otherwise.
 
 - 
exploreTilepublic boolean exploreTile(Tile tile) Sets the given tile to be explored by this player and updates the player's information about the tile. +til: Exploring the tile also updates the pet.- Parameters:
- tile- The- Tileto explore.
- Returns:
- True if the tile is newly explored by this action.
 
 - 
exploreTilespublic java.util.Set<Tile> exploreTiles(java.util.Collection<? extends Tile> tiles) Sets the tiles within the givenUnit's line of sight to be explored by this player.- Parameters:
- tiles- A list of- Tiles.
- Returns:
- A list of newly explored Tiles.
- See Also:
- hasExplored(net.sf.freecol.common.model.Tile)
 
 - 
exploreForSettlementpublic java.util.Set<Tile> exploreForSettlement(Settlement settlement) Sets the tiles visible to a given settlement to be explored by this player and updates the player's information about the tiles. Note that the player does not necessarily own the settlement (e.g. missionary at native settlement).- Parameters:
- settlement- The- Settlementthat is exploring.
- Returns:
- A list of newly explored Tiles.
 
 - 
exploreForUnitpublic java.util.Set<Tile> exploreForUnit(Unit unit) Sets the tiles within the givenUnit's line of sight to be explored by this player.- Parameters:
- unit- The- Unit.
- Returns:
- A list of newly explored Tiles.
- See Also:
- hasExplored(net.sf.freecol.common.model.Tile)
 
 - 
exploreMappublic java.util.Set<Tile> exploreMap(boolean reveal) Makes the entire map visible or invisible.- Parameters:
- reveal- If true, reveal the map, if false, hide it.
- Returns:
- A list of tiles whose visibility changed.
 
 - 
collectNewTilespublic java.util.Set<Tile> collectNewTiles(Tile center, int radius) Given a tile and new radius of visibility, explore unexplored tiles and return those plus the previously invisible tiles.- Parameters:
- center- The center- Tileto explore from.
- radius- A radius to explore to.
- Returns:
- A set of newly explored or currently invisible Tiles.
 
 - 
collectNewTilespublic java.util.Set<Tile> collectNewTiles(java.util.Collection<Tile> collection) Given a tile and new radius of visibility, explore unexplored tiles and return those plus the previously invisible tiles.- Parameters:
- collection- A- Collectionof tiles to check.
- Returns:
- A set of newly explored or currently invisible Tiles.
 
 - 
collectNewTilespublic java.util.Set<Tile> collectNewTiles(java.util.stream.Stream<Tile> tiles) Given a stream of tiles, explore unexplored tiles and return those plus the previously invisible tiles.- Parameters:
- tiles- A stream of- Tiles to check.
- Returns:
- A set of newly explored or currently invisible Tiles.
 
 - 
reassignTilespublic void reassignTiles(java.util.Collection<Tile> tiles, Settlement avoid) Try to reassign the ownership of a collection of tiles, preferring this player. Do it in two passes so the first successful claim does not give a large advantage.- Parameters:
- tiles- The collection of- Tiles to reassign.
- avoid- An optional- Settlementto consider last when making claims.
 
 - 
createUnitspublic java.util.List<Unit> createUnits(java.util.List<AbstractUnit> abstractUnits, Location location, java.util.Random random) Create units from a list of abstract units. Only used by Europeans at present. -vis: Visibility issues depending on location. -til: Tile appearance issue if created in a colony (not ATM)- Parameters:
- abstractUnits- The list of- AbstractUnits to create.
- location- The- Locationwhere the units will be created.
- random- A pseudo-random number source.
- Returns:
- A list of units created.
 
 - 
loadShipspublic java.util.List<Unit> loadShips(java.util.List<Unit> landUnits, java.util.List<Unit> navalUnits, java.util.Random random) Embark the land units. For all land units, find a naval unit to carry it. Fill greedily, so as if there is excess naval capacity then the naval units at the end of the list will tend to be empty or very lightly filled, allowing them to defend the whole fleet at full strength. Returns a list of units that could not be placed on ships. -vis: Has visibility implications depending on the initial location of the loaded units. Usually ATM this is Europe which is safe, but beware. -til: Safe while in Europe though.- Parameters:
- landUnits- A list of land units to put on ships.
- navalUnits- A list of ships to put land units on.
- random- An optional pseudo-random number source.
- Returns:
- a list of units left over
 
 - 
csFlushMarketpublic boolean csFlushMarket(ChangeSet cs) Flush any market price changes.- Parameters:
- cs- A- ChangeSetto update.
- Returns:
- True if the market has changed.
 
 - 
csFlushMarketpublic boolean csFlushMarket(GoodsType type, ChangeSet cs) Flush any market price changes for a specified goods type.- Parameters:
- type- The- GoodsTypeto check.
- cs- A- ChangeSetto update.
- Returns:
- True if the market price had changed.
 
 - 
buyInEuropepublic int buyInEurope(java.util.Random random, GoodsContainer container, GoodsType type, int amount)Buy goods in Europe.- Parameters:
- random- A pseudo-random number source.
- container- The- GoodsContainerto carry the goods.
- type- The- GoodsTypeto buy.
- amount- The amount of goods to buy.
- Returns:
- The amount actually removed from the market, or negative on failure.
 
 - 
sellInEuropepublic int sellInEurope(java.util.Random random, GoodsContainer container, GoodsType type, int amount)Sell goods in Europe.- Parameters:
- random- A pseudo-random number source.
- container- An optional- GoodsContainercarrying the goods.
- type- The- GoodsTypeto sell.
- amount- The amount of goods to sell.
- Returns:
- The amount actually added to the market, or negative on failure.
 
 - 
addStanceChangeprivate void addStanceChange(Player other) Adds a player to the list of players for whom the stance has changed.- Parameters:
- other- The- Playerto add.
 
 - 
csChangeStancepublic boolean csChangeStance(Stance stance, Player otherPlayer, boolean symmetric, ChangeSet cs) Modifies stance.- Parameters:
- stance- The new- Stance.
- otherPlayer- The- Playerwrt which the stance changes.
- symmetric- If true, change the otherPlayer stance as well.
- cs- A- ChangeSetto update.
- Returns:
- True if there was a change in stance at all.
 
 - 
csModifyTensionpublic void csModifyTension(Player player, int add, ChangeSet cs) Modifies the hostility against the given player. +til: Handles tile modifications.- Parameters:
- player- The- Player.
- add- The amount to add to the current tension level.
- cs- A- ChangeSetto update.
 
 - 
csModifyTensionpublic void csModifyTension(Player player, int add, Settlement origin, ChangeSet cs) Modifies the hostility against the given player. +til: Handles tile modifications.- Parameters:
- player- The- Player.
- add- The amount to add to the current tension level.
- origin- A- Settlementwhere the alarming event occurred.
- cs- A- ChangeSetto update.
 
 - 
csPayUpkeepprivate void csPayUpkeep(java.util.Random random, ChangeSet cs)Pay upkeep on the player resources.- Parameters:
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csNaturalDisastersprivate void csNaturalDisasters(java.util.Random random, ChangeSet cs, int probability)Check for natural disasters.- Parameters:
- random- A- Randomnumber source.
- cs- A- ChangeSetto update.
- probability- The percentage probability of a disaster occuring.
 
 - 
csApplyDisasterpublic java.util.List<ModelMessage> csApplyDisaster(java.util.Random random, Colony colony, Disaster disaster, ChangeSet cs) Apply the effects of the givenDisasterto the givenColony, or thePlayerif theColonyisnull, and return a list of appropriateModelMessages. Note that a disaster might have no effect on a particular colony. In that case, the returned list is empty.- Parameters:
- random- A- Randomnumber source.
- colony- A- Colony, or- null.
- disaster- A- Disastervalue.
- cs- A- ChangeSetto update.
- Returns:
- A list of ModelMessages, possibly empty.
 
 - 
getBuildingForEffectprivate Building getBuildingForEffect(Colony colony, Effect effect, java.util.Random random) 
 - 
getUnitForEffectprivate Unit getUnitForEffect(Colony colony, Effect effect, java.util.Random random) 
 - 
propagateToEuropeanMarketspublic void propagateToEuropeanMarkets(GoodsType type, int amount, java.util.Random random) Propagate an European market trade to the other European markets.- Parameters:
- type- The type of goods that was traded.
- amount- The amount of goods that was traded.
- random- A pseudo-random number source (note: may be null in some cases).
 
 - 
csYearlyGoodsAdjustpublic void csYearlyGoodsAdjust(java.util.Random random, ChangeSet cs)Add or remove a standard yearly amount of storable goods, and a random extra amount of a random type. Then push out all the accumulated trades. Public for the test suite.- Parameters:
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csStartTurnpublic void csStartTurn(java.util.Random random, ChangeSet cs)Starts a new turn for a player.- Parameters:
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csBombardEnemyShipsprivate void csBombardEnemyShips(java.util.Random random, ChangeSet cs)All player colonies bombard all available targets.- Parameters:
- random- A random number source.
- cs- A- ChangeSetto update.
 
 - 
csAddFoundingFatherpublic void csAddFoundingFather(FoundingFather father, java.util.Random random, ChangeSet cs) Adds a founding father to a players continental congress.- Parameters:
- father- The- FoundingFatherto add.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
getFreeBuildingTypespublic java.util.List<BuildingType> getFreeBuildingTypes() Get a list of free building types this player has access to through its choice of founding fathers. Used to upgrade newly captured colonies.- Returns:
- A list of free BuildingTypes.
 
 - 
csClaimLandpublic void csClaimLand(Tile tile, Settlement settlement, int price, ChangeSet cs) Claim land.- Parameters:
- tile- The- Tileto claim.
- settlement- The- Settlementto claim for.
- price- The price to pay for the land, which must agree with the owner valuation, unless negative which denotes stealing.
- cs- A- ChangeSetto update.
 
 - 
csEmigratepublic void csEmigrate(int slot, Europe.MigrationType type, java.util.Random random, ChangeSet cs)A unit migrates from Europe.- Parameters:
- slot- The slot within- Europeto select the unit from.
- type- The type of migration occurring.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csCombatpublic void csCombat(FreeColGameObject attacker, FreeColGameObject defender, java.util.List<CombatModel.CombatResult> crs, java.util.Random random, ChangeSet cs) Combat.- Parameters:
- attacker- The- FreeColGameObjectthat is attacking.
- defender- The- FreeColGameObjectthat is defending.
- crs- A list of- CombatResults defining the result.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
getSlaughterTensionprivate int getSlaughterTension(Unit loser) Gets the amount to raise tension by when a unit is slaughtered.- Parameters:
- loser- The- Unitthat dies.
- Returns:
- An amount to raise tension by.
 
 - 
csAutoequipUnitprivate void csAutoequipUnit(Unit unit, Settlement settlement, ChangeSet cs) Notifies of automatic arming.- Parameters:
- unit- The- Unitthat is auto-equipping.
- settlement- The- Settlementbeing defended.
- cs- A- ChangeSetto update.
 
 - 
csBurnMissionsprivate void csBurnMissions(Unit attacker, IndianSettlement is, ChangeSet cs) Burns a players missions.- Parameters:
- attacker- The- Unitthat attacked.
- is- The- IndianSettlementthat was attacked.
- cs- The- ChangeSetto update.
 
 - 
csCaptureAutoEquipprivate void csCaptureAutoEquip(Unit attacker, Unit defender, ChangeSet cs) Defender auto equips but loses and attacker captures the equipment.- Parameters:
- attacker- The- Unitthat attacked.
- defender- The- Unitthat defended and loses equipment.
- cs- A- ChangeSetto update.
 
 - 
csCaptureColonyprivate void csCaptureColony(Unit attacker, ServerColony colony, java.util.Random random, ChangeSet cs) Captures a colony.- Parameters:
- attacker- The attacking- Unit.
- colony- The- ServerColonyto capture.
- random- A pseudo-random number source.
- cs- The- ChangeSetto update.
 
 - 
csCaptureConvertprivate void csCaptureConvert(Unit attacker, IndianSettlement is, java.util.Random random, ChangeSet cs) Extracts a convert from a native settlement.- Parameters:
- attacker- The- Unitthat is attacking.
- is- The- IndianSettlementunder attack.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csCaptureEquipprivate void csCaptureEquip(Unit winner, Unit loser, ChangeSet cs) Captures equipment.- Parameters:
- winner- The- Unitthat captures equipment.
- loser- The- Unitthat defended and loses equipment.
- cs- A- ChangeSetto update.
 
 - 
csCaptureEquipmentprivate void csCaptureEquipment(Unit winner, Unit loser, Role role, ChangeSet cs) Capture equipment.- Parameters:
- winner- The- Unitthat is capturing equipment.
- loser- The- Unitthat is losing equipment.
- role- The- Rolewrest from the loser.
- cs- A- ChangeSetto update.
 
 - 
csCaptureUnitprivate void csCaptureUnit(Unit winner, Unit loser, ChangeSet cs) Capture a unit.- Parameters:
- winner- A- Unitthat is capturing.
- loser- A- Unitto capture.
- cs- A- ChangeSetto update.
 
 - 
csDamageColonyShipsprivate void csDamageColonyShips(Unit attacker, Colony colony, ChangeSet cs) Damages all ships in a colony in preparation for capture.- Parameters:
- attacker- The- Unitthat is damaging.
- colony- The- Colonyto damage ships in.
- cs- A- ChangeSetto update.
 
 - 
csDamageShipAttackprivate void csDamageShipAttack(Unit attacker, Unit ship, ChangeSet cs) Damage a ship through normal attack.- Parameters:
- attacker- The attacker- Unit.
- ship- The- Unitwhich is a ship to damage.
- cs- A- ChangeSetto update.
 
 - 
csDamageShipBombardprivate void csDamageShipBombard(Settlement settlement, Unit ship, ChangeSet cs) Damage a ship through bombard.- Parameters:
- settlement- The attacker- Settlement.
- ship- The- Unitwhich is a ship to damage.
- cs- A- ChangeSetto update.
 
 - 
csDamageShipprivate void csDamageShip(Unit ship, Location repair, ChangeSet cs) Damage a ship.- Parameters:
- ship- The naval- Unitto damage.
- repair- The- Locationto send it to.
- cs- A- ChangeSetto update.
 
 - 
csDemoteUnitprivate void csDemoteUnit(Unit winner, Unit loser, ChangeSet cs) Demotes a unit.- Parameters:
- winner- The- Unitthat won.
- loser- The- Unitthat lost and should be demoted.
- cs- A- ChangeSetto update.
 
 - 
csDestroyColonyprivate void csDestroyColony(Unit attacker, Colony colony, java.util.Random random, ChangeSet cs) Destroy a colony.- Parameters:
- attacker- The- Unitthat attacked.
- colony- The- Colonythat was attacked.
- random- A pseudo-random number source.
- cs- The- ChangeSetto update.
 
 - 
csDestroySettlementprivate void csDestroySettlement(Unit attacker, IndianSettlement is, java.util.Random random, ChangeSet cs) Destroys an Indian settlement.- Parameters:
- attacker- The attacking- Unit.
- is- An- IndianSettlementto destroy.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csDisposeSettlementpublic void csDisposeSettlement(Settlement settlement, ChangeSet cs) Disposes of a settlement and reassign its tiles. +vis,til: Resolves the whole mess.- Parameters:
- settlement- The- Settlementunder attack.
- cs- A- ChangeSetto update.
 
 - 
csEvadeAttackprivate void csEvadeAttack(Unit attacker, Unit defender, ChangeSet cs) Evade a normal attack.- Parameters:
- attacker- The attacker- Unit.
- defender- A naval- Unitthat evades the attacker.
- cs- A- ChangeSetto update.
 
 - 
csEvadeBombardprivate void csEvadeBombard(Settlement settlement, Unit defender, ChangeSet cs) Evade a bombardment.- Parameters:
- settlement- The attacker- Settlement.
- defender- A naval- Unitthat evades the attacker.
- cs- A- ChangeSetto update.
 
 - 
csLootShipprivate void csLootShip(Unit winner, Unit loser, ChangeSet cs) Loot a ship.- Parameters:
- winner- The winning naval- Unit.
- loser- The losing naval- Unit
- cs- A- ChangeSetto update.
 
 - 
csLoseAutoEquipprivate void csLoseAutoEquip(Unit attacker, Unit defender, ChangeSet cs) Unit auto equips but loses equipment.- Parameters:
- attacker- The- Unitthat attacked.
- defender- The- Unitthat defended and loses equipment.
- cs- A- ChangeSetto update.
 
 - 
csLoseEquipprivate void csLoseEquip(Unit winner, Unit loser, ChangeSet cs) Unit drops some equipment.- Parameters:
- winner- The- Unitthat won.
- loser- The- Unitthat lost and loses equipment.
- cs- A- ChangeSetto update.
 
 - 
csLoseLocationpublic void csLoseLocation(Location loc, ChangeSet cs) Hook for when a player loses access to a location for whatever reason. Useful for disabling trade routes.- Parameters:
- loc- The- Locationthat was lost.
- cs- A- ChangeSetto update.
 
 - 
csPillageColonyprivate void csPillageColony(Unit attacker, Colony colony, java.util.Random random, ChangeSet cs) Damage a building or a ship or steal some goods or gold.- Parameters:
- attacker- The attacking- Unit.
- colony- The- Colonyto pillage.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csDamageBuildingprivate void csDamageBuilding(Building building, ChangeSet cs) Damage a building in a colony by downgrading it if possible and destroying it otherwise. This is called as a result of pillaging, which always updates the colony tile.- Parameters:
- building- The- Buildingto damage.
- cs- a- ChangeSetvalue
 
 - 
csPromoteUnitprivate void csPromoteUnit(Unit winner, ChangeSet cs) Promotes a unit.- Parameters:
- winner- The- Unitthat won and should be promoted.
- cs- A- ChangeSetto update.
 
 - 
csSinkColonyShipsprivate void csSinkColonyShips(Unit attacker, Colony colony, ChangeSet cs) Sinks all ships in a colony.- Parameters:
- attacker- The attacker- Unit.
- colony- The- Colonyto sink ships in.
- cs- A- ChangeSetto update.
 
 - 
csSinkShipAttackprivate void csSinkShipAttack(Unit attacker, Unit ship, ChangeSet cs) Sinks this ship as result of a normal attack.- Parameters:
- attacker- The attacker- Unit.
- ship- The naval- Unitto sink.
- cs- A- ChangeSetto update.
 
 - 
csSinkShipBombardprivate void csSinkShipBombard(Settlement settlement, Unit ship, ChangeSet cs) Sinks this ship as result of a bombard.- Parameters:
- settlement- The bombarding- Settlement.
- ship- The naval- Unitto sink.
- cs- A- ChangeSetto update.
 
 - 
csSinkShipprivate void csSinkShip(Unit ship, Player attackerPlayer, ChangeSet cs) Sink the ship.- Parameters:
- ship- The naval- Unitto sink.
- attackerPlayer- The- Playerthat attacked, or null
- cs- A- ChangeSetto update.
 
 - 
csSlaughterUnitprivate void csSlaughterUnit(Unit winner, Unit loser, ChangeSet cs) Slaughter a unit.- Parameters:
- winner- The- Unitthat is slaughtering.
- loser- The- Unitto slaughter.
- cs- A- ChangeSetto update.
 
 - 
csSeeNewTilespublic void csSeeNewTiles(java.util.Collection<? extends Tile> newTiles, ChangeSet cs) Updates the player view for each new tile on a supplied list, and update a ChangeSet as well.- Parameters:
- newTiles- A list of- Tiles to update.
- cs- A- ChangeSetto update.
 
 - 
makeTeaPartyModifierpublic Modifier makeTeaPartyModifier() Make a tea party modifier for the current turn. Public for the test suite.- Returns:
- A tea party Modifier.
 
 - 
csRaiseTaxpublic void csRaiseTax(int tax, Goods goods, boolean accepted, ChangeSet cs)Raises the players tax rate, or handles a goods party.- Parameters:
- tax- The new tax rate.
- goods- The- Goodsto use in a goods party.
- accepted- Whether the tax raise was accepted.
- cs- A- ChangeSetto update.
 
 - 
ignoreTaxpublic void ignoreTax(int tax, Goods goods, ChangeSet cs)Handle the end of a session where the player has ignored a tax increase demand.- Parameters:
- tax- The new tax rate.
- goods- The- Goodsto use in a goods party.
- cs- A- ChangeSetto update.
 
 - 
ignoreMercenariespublic void ignoreMercenaries(ChangeSet cs) Handle the end of a session where the player has ignored an offer of mercenaries.- Parameters:
- cs- A- ChangeSetto update.
 
 - 
csMercenariespublic void csMercenaries(int price, java.util.List<AbstractUnit> mercenaries, Monarch.MonarchAction action, java.util.Random random, ChangeSet cs)Add an independent (non-monarch) mercenary offer to the player.- Parameters:
- price- The price to charge for the mercenaries.
- mercenaries- A list of mercenary units.
- action- The monarch action that caused the offer.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csSetTaxpublic void csSetTax(int tax, ChangeSet cs)Set the player tax rate. If this requires a change to the bells bonuses, we have to update the whole player (bah) because we can not yet independently update the feature container.- Parameters:
- tax- The new tax rate.
- cs- A- ChangeSetto update.
 
 - 
csAddMercenariespublic void csAddMercenaries(java.util.List<AbstractUnit> mercs, int price, java.util.Random random, ChangeSet cs) Adds mercenaries that the player has accepted.- Parameters:
- mercs- A list of mercenaries.
- price- The price to be charged for them.
- random- A pseudo-random number source.
- cs- A- ChangeSetto update.
 
 - 
csContactpublic boolean csContact(Player other, ChangeSet cs) Make contact between two nations if necessary.- Parameters:
- other- The other- Player.
- cs- A- ChangeSetto update.
- Returns:
- True if this was a first contact.
 
 - 
csNativeFirstContactpublic void csNativeFirstContact(Player other, Tile tile, ChangeSet cs) Initiate first contact between this European and native player.- Parameters:
- other- The native- Player.
- tile- The- Tilecontact is made at if this is a first landing in the new world and it is owned by the other player.
- cs- A- ChangeSetto update.
 
 - 
csEuropeanFirstContactpublic void csEuropeanFirstContact(Unit unit, Settlement settlement, Unit otherUnit, ChangeSet cs) Initiate first contact between this European and another European player.- Parameters:
- unit- The- Unitmaking contact.
- settlement- The- Settlementbeing contacted.
- otherUnit- The other- Unitbeing contacted.
- cs- A- ChangeSetto update.
 
 - 
csChangeOwnerpublic boolean csChangeOwner(Unit unit, Player newOwner, java.lang.String change, Location loc, ChangeSet cs) Change the owner of a unit or dispose of it if the change is impossible. Move the unit to a new location if necessary. Also handle disappearance of any carried units that will now be invisible to the new owner. -vis(owner,newOwner)- Parameters:
- unit- The- Unitto change ownership of.
- newOwner- The new owning- Player.
- change- An optional accompanying change type.
- loc- A optional new- Locationfor the unit.
- cs- A- ChangeSetto update.
- Returns:
- True if the new owner can have this unit.
 
 - 
csCompleteNativeDemandpublic void csCompleteNativeDemand(ServerPlayer demandPlayer, Unit unit, Colony colony, GoodsType type, int amount, Constants.IndianDemandAction result, ChangeSet cs) Accept the native demand at a players colony.- Parameters:
- demandPlayer- The- ServerPlayerthat is demanding.
- unit- The- Unitthat demanded.
- colony- The- Colonythat was demanded of.
- type- The- GoodsTypedemanded, or null for gold.
- amount- The amount demanded.
- result- The result of the demand.
- cs- A- ChangeSetto update.
 
 - 
csDiplomacypublic void csDiplomacy(DiplomacySession session, DiplomaticTrade agreement, ChangeSet cs) Process European diplomacy according to an agreement.- Parameters:
- session- The- DiplomacySessionunderway.
- agreement- The- DiplomaticTradeto consider.
- cs- A- ChangeSetto update.
 
 - 
csEndTurnpublic void csEndTurn(ChangeSet cs) Things to do just before ending the turn for a player.- Parameters:
- cs- A- ChangeSetto update.
 
 - 
csNewTurnpublic void csNewTurn(java.util.Random random, LogBuilder lb, ChangeSet cs)New turn for this player.
 
- 
 
-