Class BuyWeaponHighPirateActivityHalfSlotsFilledStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.BaseBuyWeaponStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.BuyWeaponHighPirateActivityHalfSlotsFilledStrategy
-
- All Implemented Interfaces:
ch.sahits.game.openpatrician.model.player.IAIBuyWeaponStrategy
public class BuyWeaponHighPirateActivityHalfSlotsFilledStrategy extends BaseBuyWeaponStrategy
Strategy to buy weapons when the pirate activity is high to fill half the ships slot with weapons.- Author:
- Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 18, 2017
-
-
Constructor Summary
Constructors Constructor Description BuyWeaponHighPirateActivityHalfSlotsFilledStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.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-
Methods inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BaseBuyWeaponStrategy
buyLargeWeapon, buySmallWeapon, buyWeapons, buyWeaponsOrdered, getNumberOfEmptyLargeWeaponSlots, getNumberOfEmptyWeaponSlots, getNumberOfWeaponSlots, getWeaponAmount
-
-
-
-
Method Detail
-
shouldBuyWeapons
public java.util.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
- 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
-
-