Package net.sf.colossus.variant
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 boolean
private final AllCreatureType
private static final Logger
private final Map<RecruitingSubTree.RecruiterAndRecruit,
Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAny
(CreatureType recruit, int number) void
void
addDemiLord
(CreatureType recruit, int number) void
addLord
(CreatureType recruit, int number) void
addNonLord
(CreatureType recruit, int number) void
addRegular
(CreatureType recruiter, CreatureType recruit, int number) void
complete
(boolean regularRecruit) private void
static 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 boolean
isADeadEnd
(Variant variant, CreatureType creature) private boolean
isRegularAncestorOf
(CreatureType a, CreatureType b, Set<CreatureType> checked) int
maximumNumberNeededOf
(CreatureType ct, MasterHex hex) int
numberOfRecruiterNeeded
(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:IRecruiting
Return the number of recruiter needed to obtain a recruit in hex- Specified by:
numberOfRecruiterNeeded
in 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:
getPossibleRecruits
in interfaceIRecruiting
- Parameters:
hex
- The hexagon to consider- Returns:
- All CreatureType that can be recruited in hex
-
getPossibleRecruiters
Description copied from interface:IRecruiting
Return all the CreatureType that can be recruits (something) in the hex.- Specified by:
getPossibleRecruiters
in interfaceIRecruiting
- Parameters:
hex
- The hexagon to consider- Returns:
- All CreatureType that can recruit in hex
-
maximumNumberNeededOf
- Specified by:
maximumNumberNeededOf
in 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)
-