Class RecruitingSubTree
java.lang.Object
net.sf.colossus.variant.RecruitingSubTree
- All Implemented Interfaces:
IRecruiting
The recruiting sub-tree in a terrain (or several terrains)
- Author:
- Romain Dolbeau
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<ICustomRecruitBase> private final Set<CreatureType> private final Map<CreatureType, Integer> private final Map<CreatureType, Integer> private final Map<CreatureType, Integer> private final Map<CreatureType, Integer> private booleanprivate final AllCreatureTypeprivate static final Loggerprivate final Map<RecruitingSubTree.RecruiterAndRecruit, Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAny(CreatureType recruit, int number) voidvoidaddDemiLord(CreatureType recruit, int number) voidaddLord(CreatureType recruit, int number) voidaddNonLord(CreatureType recruit, int number) voidaddRegular(CreatureType recruiter, CreatureType recruit, int number) voidcomplete(boolean regularRecruit) private voidstatic Set<CreatureType> getAllInAllSubtreesIgnoringSpecials(Variant variant, CreatureType creature) private static Set<CreatureType> getAllInAllSubtreesIgnoringSpecialsRec(Variant variant, Map<MasterBoardTerrain, Set<CreatureType>> checked, CreatureType creature) Return all the CreatureType that can be recruits (something) in the hex.WARNING: This function, trough the CustomRecruitBase, can cause a caretaker update.static booleanisADeadEnd(Variant variant, CreatureType creature) private booleanisRegularAncestorOf(CreatureType a, CreatureType b, Set<CreatureType> checked) intmaximumNumberNeededOf(CreatureType ct, MasterHex hex) intnumberOfRecruiterNeeded(CreatureType recruiter, CreatureType recruit, MasterHex hex) Return the number of recruiter needed to obtain a recruit in hextoString()
-
Field Details
-
LOGGER
-
regular
-
any
-
anyNonLord
-
anyLord
-
anyDemiLord
-
allCustom
-
allRecruits
-
completed
private boolean completed -
creatureTypes
-
-
Constructor Details
-
RecruitingSubTree
-
-
Method Details
-
toString
-
isRegularAncestorOf
-
completeGraph
private void completeGraph() -
complete
public void complete(boolean regularRecruit) -
addRegular
-
addAny
-
addNonLord
-
addLord
-
addDemiLord
-
addCustom
-
numberOfRecruiterNeeded
Description copied from interface:IRecruitingReturn the number of recruiter needed to obtain a recruit in hex- Specified by:
numberOfRecruiterNeededin interfaceIRecruiting- Parameters:
recruiter- The Recruiterrecruit- The Recruithex- The hexagon in which the recruiting occurs- Returns:
- The number of recruiter needed to obtain a recruit in hex
-
getPossibleRecruits
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:
getPossibleRecruitsin interfaceIRecruiting- Parameters:
hex- The hexagon to consider- Returns:
- All CreatureType that can be recruited in hex
-
getPossibleRecruiters
Description copied from interface:IRecruitingReturn all the CreatureType that can be recruits (something) in the hex.- Specified by:
getPossibleRecruitersin interfaceIRecruiting- Parameters:
hex- The hexagon to consider- Returns:
- All CreatureType that can recruit in hex
-
maximumNumberNeededOf
- Specified by:
maximumNumberNeededOfin interfaceIRecruiting
-
isADeadEnd
-
getAllInAllSubtreesIgnoringSpecials
public static Set<CreatureType> getAllInAllSubtreesIgnoringSpecials(Variant variant, CreatureType creature) -
getAllInAllSubtreesIgnoringSpecialsRec
private static Set<CreatureType> getAllInAllSubtreesIgnoringSpecialsRec(Variant variant, Map<MasterBoardTerrain, Set<CreatureType>> checked, CreatureType creature)
-