Class OnlyTradingOfficeRepairStrategy

  • All Implemented Interfaces:
    ch.sahits.game.openpatrician.model.player.IAIShipRepairStrategy

    public class OnlyTradingOfficeRepairStrategy
    extends BaseRepairStrategy
    Repair strategy for only repairing in town where the player has a trading office.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldRepair​(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city)
      Unless the damage is heave only in towns where hte vessel owner has a trading office repairs should be conducted.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OnlyTradingOfficeRepairStrategy

        public OnlyTradingOfficeRepairStrategy()
    • Method Detail

      • shouldRepair

        public boolean shouldRepair​(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
                                    ch.sahits.game.openpatrician.model.city.ICity city)
        Unless the damage is heave only in towns where hte vessel owner has a trading office repairs should be conducted.
        Parameters:
        vessel - that should be checked for repair need.
        city - current possition of the vessel.
        Returns:
        true if the ship should be repaired in the city.