Class RecruitingSubTree

  • All Implemented Interfaces:
    IRecruiting

    public class RecruitingSubTree
    extends java.lang.Object
    implements IRecruiting
    The recruiting sub-tree in a terrain (or several terrains)
    Author:
    Romain Dolbeau
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • any

        private final java.util.Map<CreatureType,​java.lang.Integer> any
      • anyNonLord

        private final java.util.Map<CreatureType,​java.lang.Integer> anyNonLord
      • anyLord

        private final java.util.Map<CreatureType,​java.lang.Integer> anyLord
      • anyDemiLord

        private final java.util.Map<CreatureType,​java.lang.Integer> anyDemiLord
      • allRecruits

        private final java.util.Set<CreatureType> allRecruits
      • completed

        private boolean completed
    • Constructor Detail

      • RecruitingSubTree

        public RecruitingSubTree​(AllCreatureType creatureTypes)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • completeGraph

        private void completeGraph()
      • complete

        public void complete​(boolean regularRecruit)
      • addAny

        public void addAny​(CreatureType recruit,
                           int number)
      • addNonLord

        public void addNonLord​(CreatureType recruit,
                               int number)
      • addLord

        public void addLord​(CreatureType recruit,
                            int number)
      • addDemiLord

        public void addDemiLord​(CreatureType recruit,
                                int number)
      • numberOfRecruiterNeeded

        public int numberOfRecruiterNeeded​(CreatureType recruiter,
                                           CreatureType recruit,
                                           MasterHex hex)
        Description copied from interface: IRecruiting
        Return the number of recruiter needed to obtain a recruit in hex
        Specified by:
        numberOfRecruiterNeeded in interface IRecruiting
        Parameters:
        recruiter - The Recruiter
        recruit - The Recruit
        hex - The hexagon in which the recruiting occurs
        Returns:
        The number of recruiter needed to obtain a recruit in hex
      • getPossibleRecruits

        public java.util.Set<CreatureType> getPossibleRecruits​(MasterHex hex)
        WARNING: This function, trough the CustomRecruitBase, can cause a caretaker update. It should not be called under circumstances where this update is bad.
        Specified by:
        getPossibleRecruits in interface IRecruiting
        Parameters:
        hex - The hexagon to consider
        Returns:
        All CreatureType that can be recruited in hex
      • getPossibleRecruiters

        public java.util.Set<CreatureType> getPossibleRecruiters​(MasterHex hex)
        Description copied from interface: IRecruiting
        Return all the CreatureType that can be recruits (something) in the hex.
        Specified by:
        getPossibleRecruiters in interface IRecruiting
        Parameters:
        hex - The hexagon to consider
        Returns:
        All CreatureType that can recruit in hex
      • getAllInAllSubtreesIgnoringSpecials

        public static java.util.Set<CreatureType> getAllInAllSubtreesIgnoringSpecials​(Variant variant,
                                                                                      CreatureType creature)