Class StorageBasedEventDecisionStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.StorageBasedEventDecisionStrategy
-
- All Implemented Interfaces:
IAIEventDecisionStrategy
public class StorageBasedEventDecisionStrategy extends java.lang.Object implements IAIEventDecisionStrategy
Event decision strategy based on the stored amount of required goofs.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Dec 18, 2016
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<IWare,java.lang.Integer>
minAmounts
-
Constructor Summary
Constructors Constructor Description StorageBasedEventDecisionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptMarriagBrokereOffer(IAIPlayer player)
Decide if the offer of a marriage broker should be accepted.boolean
acceptMarriageOffer(IAIPlayer player)
Decide if a marriage offer should be accepted.private boolean
enoughStored(IPlayer player, ICity city)
boolean
shouldOrderCelebration(IAIPlayer player, ICity city)
Decide if a celebration should be executed.
-
-
-
Field Detail
-
minAmounts
private java.util.Map<IWare,java.lang.Integer> minAmounts
-
-
Method Detail
-
acceptMarriagBrokereOffer
public boolean acceptMarriagBrokereOffer(IAIPlayer player)
Description copied from interface:IAIEventDecisionStrategy
Decide if the offer of a marriage broker should be accepted.- Specified by:
acceptMarriagBrokereOffer
in interfaceIAIEventDecisionStrategy
- Parameters:
player
- who has to make the decision- Returns:
- true if the player accepts the marriage broker offer
-
acceptMarriageOffer
public boolean acceptMarriageOffer(IAIPlayer player)
Description copied from interface:IAIEventDecisionStrategy
Decide if a marriage offer should be accepted.- Specified by:
acceptMarriageOffer
in interfaceIAIEventDecisionStrategy
- Parameters:
player
- who has to make the decision- Returns:
- true if hte player accepts the marriage offer
-
shouldOrderCelebration
public boolean shouldOrderCelebration(IAIPlayer player, ICity city)
Description copied from interface:IAIEventDecisionStrategy
Decide if a celebration should be executed.- Specified by:
shouldOrderCelebration
in interfaceIAIEventDecisionStrategy
- Parameters:
player
- who has to make the decisioncity
- where the celebration takes place- Returns:
- true if the player whished to order a celebration in city.
-
-