Class AIPlayer
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.impl.Player
-
- ch.sahits.game.openpatrician.model.impl.AIPlayer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTradeStep(ITradeStep tradeStep, INavigableVessel vessel)Add a new trade step at the end of the list.IAIGuildJoinStrategyTypegetGuildJoinStrategyType()Retrieve the strategy to join guilds.IAIHireSailorsStrategyTypegetHireSailorStrategyType()Retreive the strategy type for hiring the sailors.IAIHireTradeManagerStrategyTypegetHireTradeManagerStrategyType()Retrieve the strategy for hiring and dismissing trade managers.ITradeStepgetNextTradeStep(INavigableVessel vessel)Retrieve the next trade step that should be executed and remove it from the list.IProductionConsumptionKnowledgegetProductionAndConsumptionKnowledge()Retrieve the knowledge of production and consumption.IAIShipUpgradeStrategyTypegetShipUpgradeStrategyType()Retrieve the strategy type for upgrading ships.ITradeMissionDatagetTradeMission(INavigableVessel vessel)Retrieve the trade mission of a given vessel.java.util.List<ITradeStep>getTradeSteps(INavigableVessel vessel)Retrieve a copy of the trade steps of the vessel.IAITradeStrategyTypegetTradeStrategyType(INavigableVessel vessel)Retreive the the type of trade strategy.IAIBuyWeaponStrategyTypegetWeaponBuyStrategyType()Retrieve the strategy type for buying weapons.booleanhasMoreTradeSteps(INavigableVessel vessel)Check if there are further trade steps.voidinjectTradeStep(ITradeStep tradeStep, INavigableVessel vessel)Inject a trade step at the beinning of the task list for the vesselbooleanisInitialized(INavigableVessel vessel)Check if the trade strategy for the vessel is initialized.voidsetTradeMission(INavigableVessel vessel, ITradeMissionData tradeMission)Add trade mission data fo a vessel.voidsetTradeStrategyType(INavigableVessel vessel, IAITradeStrategyType type)Set the trade strategy type on the level of a vessel.voidupdateTradeWaitingStatus(INavigableVessel vessel, boolean wait)Update the waiting status upon the execution of a trade step.booleanwaitingForTradeStepToFinish(INavigableVessel vessel)Check if the next trade step can be executed for the vessel, or if the last trade step requires waiting on an event.-
Methods inherited from class ch.sahits.game.openpatrician.model.impl.Player
addSelectableVessel, addShip, equals, findBuildings, findBuildings, findShips, findTradingOffice, getFleet, getHometown, getLastName, getName, getPersonalData, getSelectableVessels, getSpouseData, hashCode, marry, receiveSum, removeSelectableVessel, removeShip, spouseDies, toString, updateCrimialDrive, updateRank
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.IAIPlayer
getCaptainHireStrategyType, getConstructionSelectionType, getEventDecitionStrategyType, getPlayerContext, getShipRepairStrategyType, getTakeLoanStrategyType
-
Methods inherited from interface ch.sahits.game.openpatrician.model.ICitizen
getHometown, getLastName, getName, getRank
-
Methods inherited from interface ch.sahits.game.openpatrician.model.city.ICreditor
receiveSum
-
Methods inherited from interface ch.sahits.game.openpatrician.model.IPlayer
addSelectableVessel, addShip, findBuildings, findBuildings, findShips, findTradingOffice, getCareerLevel, getChildren, getCompany, getCriminalDrive, getFleet, getPersonalData, getSegmentedMap, getSelectableVessels, getSpouseData, getUuid, marry, removeSelectableVessel, removeShip, setCareerLevel, setSegmentedMap, spouseDies, updateCrimialDrive, updateRank
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.IShipOwner
getLastName, getName
-
-
-
-
Method Detail
-
getProductionAndConsumptionKnowledge
public IProductionConsumptionKnowledge getProductionAndConsumptionKnowledge()
Description copied from interface:IAIPlayerRetrieve the knowledge of production and consumption.- Specified by:
getProductionAndConsumptionKnowledgein interfaceIAIPlayer- Returns:
- global knowledge of production and consumption.
-
getNextTradeStep
public ITradeStep getNextTradeStep(INavigableVessel vessel)
Description copied from interface:IAIPlayerRetrieve the next trade step that should be executed and remove it from the list.- Specified by:
getNextTradeStepin interfaceIAIPlayer- Parameters:
vessel- for which the next trade step should be checked.- Returns:
- next trade step for the vessel
-
hasMoreTradeSteps
public boolean hasMoreTradeSteps(INavigableVessel vessel)
Description copied from interface:IAIPlayerCheck if there are further trade steps.- Specified by:
hasMoreTradeStepsin interfaceIAIPlayer- Parameters:
vessel- which should be checked.- Returns:
- true if there are more trade steps defined for vessel
-
addTradeStep
public void addTradeStep(ITradeStep tradeStep, INavigableVessel vessel)
Description copied from interface:IAIPlayerAdd a new trade step at the end of the list.- Specified by:
addTradeStepin interfaceIAIPlayer- Parameters:
tradeStep- to be added.vessel- for which the step should be added.
-
injectTradeStep
public void injectTradeStep(ITradeStep tradeStep, INavigableVessel vessel)
Description copied from interface:IAIPlayerInject a trade step at the beinning of the task list for the vessel- Specified by:
injectTradeStepin interfaceIAIPlayer- Parameters:
tradeStep- to be added.vessel- for which the step should be added.
-
getTradeMission
public ITradeMissionData getTradeMission(INavigableVessel vessel)
Description copied from interface:IAIPlayerRetrieve the trade mission of a given vessel.- Specified by:
getTradeMissionin interfaceIAIPlayer- Parameters:
vessel- for which to get the mission data- Returns:
- trade mission for a specific vessel
-
setTradeMission
public void setTradeMission(INavigableVessel vessel, ITradeMissionData tradeMission)
Description copied from interface:IAIPlayerAdd trade mission data fo a vessel. If the data is null an existing entry will be removed.- Specified by:
setTradeMissionin interfaceIAIPlayer- Parameters:
vessel- for which to set the trade mission datatradeMission- trade mission meta data
-
waitingForTradeStepToFinish
public boolean waitingForTradeStepToFinish(INavigableVessel vessel)
Description copied from interface:IAIPlayerCheck if the next trade step can be executed for the vessel, or if the last trade step requires waiting on an event.- Specified by:
waitingForTradeStepToFinishin interfaceIAIPlayer- Parameters:
vessel- for which the status should be checked.- Returns:
- true if the next trade step is initiated upon an event.
-
updateTradeWaitingStatus
public void updateTradeWaitingStatus(INavigableVessel vessel, boolean wait)
Description copied from interface:IAIPlayerUpdate the waiting status upon the execution of a trade step.- Specified by:
updateTradeWaitingStatusin interfaceIAIPlayer- Parameters:
vessel- for which the status should be updated.wait- inicate if the next trade step should wait.
-
isInitialized
public boolean isInitialized(INavigableVessel vessel)
Description copied from interface:IAIPlayerCheck if the trade strategy for the vessel is initialized.- Specified by:
isInitializedin interfaceIAIPlayer- Parameters:
vessel- to be checked- Returns:
- true if the trade steps for the vessel are initialized.
-
setTradeStrategyType
public void setTradeStrategyType(INavigableVessel vessel, IAITradeStrategyType type)
Set the trade strategy type on the level of a vessel.- Specified by:
setTradeStrategyTypein interfaceIAIPlayer- Parameters:
vessel- for which to set the strategy typetype- trade strategy type
-
getTradeStrategyType
public IAITradeStrategyType getTradeStrategyType(INavigableVessel vessel)
Description copied from interface:IAIPlayerRetreive the the type of trade strategy.- Specified by:
getTradeStrategyTypein interfaceIAIPlayer- Parameters:
vessel- for which to retrieve the trade strategy type- Returns:
- trade strategy type for the vessel
-
getHireTradeManagerStrategyType
public IAIHireTradeManagerStrategyType getHireTradeManagerStrategyType()
Description copied from interface:IAIPlayerRetrieve the strategy for hiring and dismissing trade managers.- Specified by:
getHireTradeManagerStrategyTypein interfaceIAIPlayer- Returns:
- strategy type to hire trade managers
-
getGuildJoinStrategyType
public IAIGuildJoinStrategyType getGuildJoinStrategyType()
Description copied from interface:IAIPlayerRetrieve the strategy to join guilds.- Specified by:
getGuildJoinStrategyTypein interfaceIAIPlayer- Returns:
- strategy type to join guilds
-
getWeaponBuyStrategyType
public IAIBuyWeaponStrategyType getWeaponBuyStrategyType()
Description copied from interface:IAIPlayerRetrieve the strategy type for buying weapons.- Specified by:
getWeaponBuyStrategyTypein interfaceIAIPlayer- Returns:
- strategy types to decide to buy weapons
-
getHireSailorStrategyType
public IAIHireSailorsStrategyType getHireSailorStrategyType()
Description copied from interface:IAIPlayerRetreive the strategy type for hiring the sailors.- Specified by:
getHireSailorStrategyTypein interfaceIAIPlayer- Returns:
- strategy type to hire sailors
-
getShipUpgradeStrategyType
public IAIShipUpgradeStrategyType getShipUpgradeStrategyType()
Description copied from interface:IAIPlayerRetrieve the strategy type for upgrading ships.- Specified by:
getShipUpgradeStrategyTypein interfaceIAIPlayer- Returns:
- strategy type for ship upgrading
-
getTradeSteps
public java.util.List<ITradeStep> getTradeSteps(INavigableVessel vessel)
Description copied from interface:IAIPlayerRetrieve a copy of the trade steps of the vessel.- Specified by:
getTradeStepsin interfaceIAIPlayer- Parameters:
vessel- for which the next trade step should be checked.- Returns:
- all trade steps for that vessel
-
-