Class TakeLoanLowMoneyLongestDurationStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.TakeLoanLowMoneyLongestDurationStrategy
-
- All Implemented Interfaces:
IAITakeLoanStrategy
public class TakeLoanLowMoneyLongestDurationStrategy extends java.lang.Object implements IAITakeLoanStrategy
Strategy for loan taking. The strategy takes effect when the money is low and taking the loan with the longest duration.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jun 12, 2016
-
-
Field Summary
Fields Modifier and Type Field Description private LoanerList
loaners
private LoanerService
loanerService
-
Constructor Summary
Constructors Constructor Description TakeLoanLowMoneyLongestDurationStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldTakeLoan(IAIPlayer player)
Check if the player should take out a loan.void
takeLoan(IAIPlayer player, ICity city)
Take a loan in the city.
-
-
-
Field Detail
-
loaners
@Autowired private LoanerList loaners
-
loanerService
@Autowired private LoanerService loanerService
-
-
Method Detail
-
shouldTakeLoan
public boolean shouldTakeLoan(IAIPlayer player)
Description copied from interface:IAITakeLoanStrategy
Check if the player should take out a loan.- Specified by:
shouldTakeLoan
in interfaceIAITakeLoanStrategy
- Parameters:
player
- to be checked.- Returns:
- true if a loan should be taken.
-
takeLoan
public void takeLoan(IAIPlayer player, ICity city)
Description copied from interface:IAITakeLoanStrategy
Take a loan in the city.- Specified by:
takeLoan
in interfaceIAITakeLoanStrategy
- Parameters:
player
- that takes out the loancity
- where the loan is taken.
-
-