Auto-format spaces to tabs (#2)

This commit is contained in:
mezz committed 2016-10-27 02:49:49 -07:00
1 parent 25be7fd254
commit 5bb4b5d9a5
756 files changed
+49198 -48489

No files matched your search

@@ -26,107 +26,107 @@ import java.util.ArrayList;
import java.util.List;
public class AnalystPageClimate extends ControlAnalystPage {
public AnalystPageClimate(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(26163);
final EnumTemperature temp = ind.getGenome().getPrimary().getTemperature();
EnumTolerance tempTol = EnumTolerance.NONE;
final EnumHumidity humid = ind.getGenome().getPrimary().getHumidity();
EnumTolerance humidTol = EnumTolerance.NONE;
if (ind instanceof IBee) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE)).getValue();
}
if (ind instanceof IFlower) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumFlowerChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = EnumTolerance.BOTH_5;
}
if (ind instanceof IButterfly) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE)).getValue();
}
int y = 4;
new ControlTextCentered(this, y, "§nClimate").setColour(this.getColour());
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Temp. Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createTemperatureBar(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, temp, tempTol);
y += 16;
if (!(ind instanceof IFlower)) {
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Humidity Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createHumidity(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, humid, humidTol);
y += 16;
}
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
final List<Biome> biomes = new ArrayList<>();
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
if (biome != null) {
if (BiomeDictionary.isBiomeRegistered(biome)) {
if (biome != Biomes.FROZEN_OCEAN) {
if (Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol)) {
if (Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
boolean match = false;
for (final Biome eBiome : biomes) {
if (biome.getBiomeName().contains(eBiome.getBiomeName()) && EnumHumidity.getFromValue(eBiome.getRainfall()) == EnumHumidity.getFromValue(biome.getRainfall()) && EnumTemperature.getFromBiome(eBiome) == EnumTemperature.getFromBiome(biome)) {
match = true;
}
}
if (!match) {
biomes.add(biome);
}
}
}
}
}
}
}
final int maxBiomePerLine = (int) ((this.w() + 2.0f - 16.0f) / 18.0f);
final float biomeListX = (this.w() - (Math.min(maxBiomePerLine, biomes.size()) * 18 - 2)) / 2.0f;
int dx = 0;
int dy = 0;
for (final Biome biome2 : biomes) {
new ControlBiome(this, biomeListX + dx, y + dy, 16.0f, 16.0f, biome2);
dx += 18;
if (dx >= 18 * maxBiomePerLine) {
dx = 0;
dy += 18;
}
}
this.setSize(new IPoint(this.w(), y + dy + 18 + 8));
}
public AnalystPageClimate(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(26163);
final EnumTemperature temp = ind.getGenome().getPrimary().getTemperature();
EnumTolerance tempTol = EnumTolerance.NONE;
final EnumHumidity humid = ind.getGenome().getPrimary().getHumidity();
EnumTolerance humidTol = EnumTolerance.NONE;
if (ind instanceof IBee) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE)).getValue();
}
if (ind instanceof IFlower) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumFlowerChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = EnumTolerance.BOTH_5;
}
if (ind instanceof IButterfly) {
tempTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE)).getValue();
humidTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE)).getValue();
}
int y = 4;
new ControlTextCentered(this, y, "§nClimate").setColour(this.getColour());
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Temp. Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createTemperatureBar(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, temp, tempTol);
y += 16;
if (!(ind instanceof IFlower)) {
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Humidity Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
this.createHumidity(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, humid, humidTol);
y += 16;
}
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
y += 12;
final List<Biome> biomes = new ArrayList<>();
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
if (biome != null) {
if (BiomeDictionary.isBiomeRegistered(biome)) {
if (biome != Biomes.FROZEN_OCEAN) {
if (Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol)) {
if (Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
boolean match = false;
for (final Biome eBiome : biomes) {
if (biome.getBiomeName().contains(eBiome.getBiomeName()) && EnumHumidity.getFromValue(eBiome.getRainfall()) == EnumHumidity.getFromValue(biome.getRainfall()) && EnumTemperature.getFromBiome(eBiome) == EnumTemperature.getFromBiome(biome)) {
match = true;
}
}
if (!match) {
biomes.add(biome);
}
}
}
}
}
}
}
final int maxBiomePerLine = (int) ((this.w() + 2.0f - 16.0f) / 18.0f);
final float biomeListX = (this.w() - (Math.min(maxBiomePerLine, biomes.size()) * 18 - 2)) / 2.0f;
int dx = 0;
int dy = 0;
for (final Biome biome2 : biomes) {
new ControlBiome(this, biomeListX + dx, y + dy, 16.0f, 16.0f, biome2);
dx += 18;
if (dx >= 18 * maxBiomePerLine) {
dx = 0;
dy += 18;
}
}
this.setSize(new IPoint(this.w(), y + dy + 18 + 8));
}
protected void createTemperatureBar(final IWidget parent, final float x, final float y, final float w, final float h, final EnumTemperature value, final EnumTolerance tol) {
new ControlToleranceBar<EnumTemperature>(parent, x, y, w, h, EnumTemperature.class) {
@Override
protected String getName(final EnumTemperature value) {
return value.name;
}
protected void createTemperatureBar(final IWidget parent, final float x, final float y, final float w, final float h, final EnumTemperature value, final EnumTolerance tol) {
new ControlToleranceBar<EnumTemperature>(parent, x, y, w, h, EnumTemperature.class) {
@Override
protected String getName(final EnumTemperature value) {
return value.name;
}
@Override
protected int getColour(final EnumTemperature value) {
return (new int[]{65531, 7912447, 5242672, 16776960, 16753152, 16711680})[value.ordinal() - 1];
}
}.setValues(value, tol);
}
@Override
protected int getColour(final EnumTemperature value) {
return (new int[]{65531, 7912447, 5242672, 16776960, 16753152, 16711680})[value.ordinal() - 1];
}
}.setValues(value, tol);
}
protected void createHumidity(final IWidget parent, final float x, final float y, final float w, final float h, final EnumHumidity value, final EnumTolerance tol) {
new ControlToleranceBar<EnumHumidity>(parent, x, y, w, h, EnumHumidity.class) {
@Override
protected String getName(final EnumHumidity value) {
return value.name;
}
protected void createHumidity(final IWidget parent, final float x, final float y, final float w, final float h, final EnumHumidity value, final EnumTolerance tol) {
new ControlToleranceBar<EnumHumidity>(parent, x, y, w, h, EnumHumidity.class) {
@Override
protected String getName(final EnumHumidity value) {
return value.name;
}
@Override
protected int getColour(final EnumHumidity value) {
return (new int[]{16770979, 1769216, 3177727})[value.ordinal()];
}
}.setValues(value, tol);
}
@Override
protected int getColour(final EnumHumidity value) {
return (new int[]{16770979, 1769216, 3177727})[value.ordinal()];
}
}.setValues(value, tol);
}
@Override
public String getTitle() {
return "Climate";
}
@Override
public String getTitle() {
return "Climate";
}
}