public class RecruitingSubTree extends java.lang.Object implements IRecruiting
Modifier and Type | Class and Description |
---|---|
private static class |
RecruitingSubTree.RecruiterAndRecruit |
Modifier and Type | Field and Description |
---|---|
private java.util.Set<ICustomRecruitBase> |
allCustom |
private java.util.Set<CreatureType> |
allRecruits |
private java.util.Map<CreatureType,java.lang.Integer> |
any |
private java.util.Map<CreatureType,java.lang.Integer> |
anyDemiLord |
private java.util.Map<CreatureType,java.lang.Integer> |
anyLord |
private java.util.Map<CreatureType,java.lang.Integer> |
anyNonLord |
private boolean |
completed |
private AllCreatureType |
creatureTypes |
private static java.util.logging.Logger |
LOGGER |
private java.util.Map<RecruitingSubTree.RecruiterAndRecruit,java.lang.Integer> |
regular |
Constructor and Description |
---|
RecruitingSubTree(AllCreatureType creatureTypes) |
Modifier and Type | Method and Description |
---|---|
void |
addAny(CreatureType recruit,
int number) |
void |
addCustom(ICustomRecruitBase crb) |
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 |
completeGraph() |
static java.util.Set<CreatureType> |
getAllInAllSubtreesIgnoringSpecials(Variant variant,
CreatureType creature) |
private static java.util.Set<CreatureType> |
getAllInAllSubtreesIgnoringSpecialsRec(Variant variant,
java.util.Map<MasterBoardTerrain,java.util.Set<CreatureType>> checked,
CreatureType creature) |
java.util.Set<CreatureType> |
getPossibleRecruiters(MasterHex hex)
Return all the CreatureType that can be recruits (something) in the hex.
|
java.util.Set<CreatureType> |
getPossibleRecruits(MasterHex 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,
java.util.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 hex
|
java.lang.String |
toString() |
private static final java.util.logging.Logger LOGGER
private final java.util.Map<RecruitingSubTree.RecruiterAndRecruit,java.lang.Integer> regular
private final java.util.Map<CreatureType,java.lang.Integer> any
private final java.util.Map<CreatureType,java.lang.Integer> anyNonLord
private final java.util.Map<CreatureType,java.lang.Integer> anyLord
private final java.util.Map<CreatureType,java.lang.Integer> anyDemiLord
private final java.util.Set<ICustomRecruitBase> allCustom
private final java.util.Set<CreatureType> allRecruits
private boolean completed
private final AllCreatureType creatureTypes
public RecruitingSubTree(AllCreatureType creatureTypes)
public java.lang.String toString()
toString
in class java.lang.Object
private boolean isRegularAncestorOf(CreatureType a, CreatureType b, java.util.Set<CreatureType> checked)
private void completeGraph()
public void complete(boolean regularRecruit)
public void addRegular(CreatureType recruiter, CreatureType recruit, int number)
public void addAny(CreatureType recruit, int number)
public void addNonLord(CreatureType recruit, int number)
public void addLord(CreatureType recruit, int number)
public void addDemiLord(CreatureType recruit, int number)
public void addCustom(ICustomRecruitBase crb)
public int numberOfRecruiterNeeded(CreatureType recruiter, CreatureType recruit, MasterHex hex)
IRecruiting
numberOfRecruiterNeeded
in interface IRecruiting
recruiter
- The Recruiterrecruit
- The Recruithex
- The hexagon in which the recruiting occurspublic java.util.Set<CreatureType> getPossibleRecruits(MasterHex hex)
getPossibleRecruits
in interface IRecruiting
hex
- The hexagon to considerpublic java.util.Set<CreatureType> getPossibleRecruiters(MasterHex hex)
IRecruiting
getPossibleRecruiters
in interface IRecruiting
hex
- The hexagon to considerpublic int maximumNumberNeededOf(CreatureType ct, MasterHex hex)
maximumNumberNeededOf
in interface IRecruiting
public static boolean isADeadEnd(Variant variant, CreatureType creature)
public static java.util.Set<CreatureType> getAllInAllSubtreesIgnoringSpecials(Variant variant, CreatureType creature)
private static java.util.Set<CreatureType> getAllInAllSubtreesIgnoringSpecialsRec(Variant variant, java.util.Map<MasterBoardTerrain,java.util.Set<CreatureType>> checked, CreatureType creature)