Class HometownRepairStrategy

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

    public class HometownRepairStrategy
    extends BaseRepairStrategy
    Repair strategy to repair the ship in the hometown.
    • 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)
      Only repair the ship in the hometown unless it is realy badly damaged.
      • Methods inherited from class java.lang.Object

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

      • HometownRepairStrategy

        public HometownRepairStrategy()
    • Method Detail

      • shouldRepair

        public boolean shouldRepair​(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
                                    ch.sahits.game.openpatrician.model.city.ICity city)
        Only repair the ship in the hometown unless it is realy badly damaged.
        Parameters:
        vessel - that should be checked for repair need.
        city - current possition of the vessel.
        Returns:
        true if the vessel should be repaired in the city.