public abstract class BaseBuyWeaponStrategy extends Object implements ch.sahits.game.openpatrician.model.player.IAIBuyWeaponStrategy
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 |
computablePrice |
private ch.sahits.game.openpatrician.model.weapon.ArmoryRegistry |
registry |
private Random |
rnd |
private ShipService |
shipService |
| Constructor and Description |
|---|
BaseBuyWeaponStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected ch.sahits.game.openpatrician.model.weapon.EWeapon |
buyLargeWeapon(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
int capacity)
Randomly select a large weapon available in the armory and buy it.
|
protected ch.sahits.game.openpatrician.model.weapon.EWeapon |
buySmallWeapon(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
int capacity)
Randomly select a small weapon available in the armory and buy it.
|
void |
buyWeapons(ch.sahits.game.openpatrician.model.player.BuyWeapons target,
ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city)
First the hand weapons are bought.
|
protected int |
getNumberOfEmptyLargeWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
Count the empty large weapon slots, where a large weapon can be placed.
|
protected int |
getNumberOfEmptyWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
Count the empty weapon slots.
|
protected int |
getNumberOfWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
Retrieve the number of weapon slots on the ship.
|
protected int |
getWeaponAmount(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
ch.sahits.game.openpatrician.model.weapon.EWeapon weapon)
Retrieve the amount of weapons available in the armory.
|
@Autowired private Random rnd
@Autowired private ch.sahits.game.openpatrician.model.weapon.ArmoryRegistry registry
@Autowired private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 computablePrice
@Autowired private ShipService shipService
protected int getNumberOfWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
protected int getNumberOfEmptyWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
protected int getNumberOfEmptyLargeWeaponSlots(ch.sahits.game.openpatrician.model.ship.IShip ship)
ship - protected int getWeaponAmount(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
ch.sahits.game.openpatrician.model.weapon.EWeapon weapon)
protected ch.sahits.game.openpatrician.model.weapon.EWeapon buyLargeWeapon(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
int capacity)
armory - protected ch.sahits.game.openpatrician.model.weapon.EWeapon buySmallWeapon(ch.sahits.game.openpatrician.model.weapon.IArmory armory,
int capacity)
armory - public void buyWeapons(ch.sahits.game.openpatrician.model.player.BuyWeapons target,
ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city)
buyWeapons in interface ch.sahits.game.openpatrician.model.player.IAIBuyWeaponStrategytarget - defining the target that should be met by buying the weapons.ship - for which the weapons should be boughtplayer - who is purchasing the weaponscity - in which to buy weaponsCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.