use of forestry.api.genetics.EnumTolerance in project Binnie by ForestryMC.
the class ControlClimateBar method setSpecies.
public void setSpecies(IAlleleBeeSpecies species) {
tolerated.clear();
int main;
EnumTolerance tolerance;
IAllele[] template = BeeManager.beeRoot.getTemplate(species);
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(template);
if (!isHumidity) {
main = species.getTemperature().ordinal() - 1;
tolerance = genome.getToleranceTemp();
} else {
main = species.getHumidity().ordinal();
tolerance = genome.getToleranceHumid();
}
tolerated.add(main);
switch(tolerance) {
case BOTH_5:
case UP_5:
{
tolerated.add(main + 5);
}
case BOTH_4:
case UP_4:
{
tolerated.add(main + 4);
}
case BOTH_3:
case UP_3:
{
tolerated.add(main + 3);
}
case BOTH_2:
case UP_2:
{
tolerated.add(main + 2);
}
case BOTH_1:
case UP_1:
{
tolerated.add(main + 1);
break;
}
}
switch(tolerance) {
case BOTH_5:
case DOWN_5:
{
tolerated.add(main - 5);
}
case BOTH_4:
case DOWN_4:
{
tolerated.add(main - 4);
}
case BOTH_3:
case DOWN_3:
{
tolerated.add(main - 3);
}
case BOTH_2:
case DOWN_2:
{
tolerated.add(main - 2);
}
case BOTH_1:
case DOWN_1:
{
tolerated.add(main - 1);
break;
}
}
}
Aggregations