public class BuyWeaponHighPirateActivityHalfSlotsFilledStrategy extends BaseBuyWeaponStrategy
| Modifier and Type | Field and Description |
|---|---|
private static long |
CASH_LIMIT |
private DangerService |
dangerService |
private PirateActivity |
pirateActivity |
private ShipService |
shipService |
| Constructor and Description |
|---|
BuyWeaponHighPirateActivityHalfSlotsFilledStrategy() |
| Modifier and Type | Method and Description |
|---|---|
Optional<ch.sahits.game.openpatrician.model.player.BuyWeapons> |
shouldBuyWeapons(ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city)
Weapons should be bought when:
There was a pirate attack every 2 weeks
There are free weapon slots
at least 10'000 cash is available
Then the amounts are calculated:
one hand weapon per sailor
Half the amount of large weapons then there are slots
Half the amount of remaining open slots for small weapons
~1/3 times the amount of free weapon slots as strength
|
buyLargeWeapon, buySmallWeapon, buyWeapons, getNumberOfEmptyLargeWeaponSlots, getNumberOfEmptyWeaponSlots, getNumberOfWeaponSlots, getWeaponAmount@Autowired private PirateActivity pirateActivity
@Autowired private DangerService dangerService
@Autowired private ShipService shipService
private static final long CASH_LIMIT
public BuyWeaponHighPirateActivityHalfSlotsFilledStrategy()
public Optional<ch.sahits.game.openpatrician.model.player.BuyWeapons> shouldBuyWeapons(ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.model.city.ICity city)
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.