Class DefaultHireSailorsStrategy

  • All Implemented Interfaces:
    IAIHireSailorStrategy

    public class DefaultHireSailorsStrategy
    extends java.lang.Object
    implements IAIHireSailorStrategy
    Strategy for calculating the sailor amount on ships based on the danger level.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Nov 04, 2017
    • Field Detail

      • rnd

        @Autowired
        private java.util.Random rnd
    • Constructor Detail

      • DefaultHireSailorsStrategy

        public DefaultHireSailorsStrategy()
    • Method Detail

      • calculateRequiredSailorAmount

        public int calculateRequiredSailorAmount​(IShip ship,
                                                 IAIPlayer player)
        Description copied from interface: IAIHireSailorStrategy
        Calculate the number of required sailors on the ship.
        Specified by:
        calculateRequiredSailorAmount in interface IAIHireSailorStrategy
        Parameters:
        ship - for which the number has to be calculated.
        player - owning the ship
        Returns:
        number of sailors that should be on the ship.