Change IAllele.getName() to IAllele.getAlleleName()

This commit is contained in:
Nedelosk committed 2017-07-30 23:40:19 +02:00
1 parent 1b722df37a
commit 687c440c69
14 files changed
+44 -39

No files matched your search

@@ -82,7 +82,7 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
y += th;
new ControlText(contents, new Area(0, y, w2, th), I18N.localise("botany.gui.database.tab.genome.nectar"), TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MIDDLE_LEFT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getAlleleName(), TextJustification.MIDDLE_LEFT);
y += th;
int x = w2;
@@ -73,7 +73,7 @@ public class Flower extends Individual implements IFlower {
@Override
public String getDisplayName() {
IAlleleFlowerSpecies species = getGenome().getPrimary();
String name = species.getName();
String name = species.getAlleleName();
if (age == 0) {
name += "";
}
@@ -44,6 +44,11 @@ public class FlowerColorAllele implements IFlowerColor, IAlleleInteger {
return name;
}
@Override
public String getAlleleName() {
return name;
}
@Override
public String getUnlocalizedName() {
return unlocalizedName;
@@ -66,6 +71,6 @@ public class FlowerColorAllele implements IFlowerColor, IAlleleInteger {
@Override
public String getColorName() {
return I18N.localise("botany.color." + getName());
return I18N.localise("botany.color." + getAlleleName());
}
}
@@ -61,9 +61,9 @@ public enum PacketID implements IPacketID {
}
if (primary == secondary) {
info = info + " " + primary.getName();
info = info + " " + primary.getAlleleName();
} else {
info = info + " " + primary.getName() + "-" + secondary.getName() + " " + I18N.localise("botany.flowers.species.hybrid");
info = info + " " + primary.getAlleleName() + "-" + secondary.getAlleleName() + " " + I18N.localise("botany.flowers.species.hybrid");
}
if (age == 0.0f) {
@@ -41,7 +41,7 @@ interface IBreedingMessage {
@Override
public String getBody() {
return this.species.getName();
return this.species.getAlleleName();
}
@Override
@@ -231,8 +231,8 @@ public class ManagerGenetics extends ManagerBase {
if (o1 instanceof IAlleleInteger && o2 instanceof IAlleleInteger && !(o1 instanceof FlowerColorAllele)) {
return Integer.valueOf(((IAlleleInteger) o1).getValue()).compareTo(((IAlleleInteger) o2).getValue());
}
if (o1.getName() != null && o2.getName() != null) {
return o1.getName().compareTo(o2.getName());
if (o1.getAlleleName() != null && o2.getAlleleName() != null) {
return o1.getAlleleName().compareTo(o2.getAlleleName());
}
return o1.getUID().compareTo(o2.getUID());
}
@@ -56,7 +56,7 @@ public class ModuleCore implements IInitializable {
outputSpecies.println("<tr>");
for (int i = 0; i < 4; ++i) {
final IAlleleTreeSpecies species = speciesQueue.poll();
outputSpecies.println("<td>" + ((species == null) ? "" : species.getName()) + "</td>");
outputSpecies.println("<td>" + ((species == null) ? "" : species.getAlleleName()) + "</td>");
}
outputSpecies.println("</tr>");
}
@@ -100,8 +100,8 @@ public class ModuleCore implements IInitializable {
outputFruit.println("<td></td>");
} else {
final String fruit = wood6.getNameOfFruit();
final String img2 = "<img alt=\"" + wood6.getName() + "\" src=\"images/fruits/" + fruit + ".png\">";
outputFruit.println("<td>" + img2 + " " + wood6.getName() + "</td>");
final String img2 = "<img alt=\"" + wood6.getAlleleName() + "\" src=\"images/fruits/" + fruit + ".png\">";
outputFruit.println("<td>" + img2 + " " + wood6.getAlleleName() + "</td>");
}
}
outputFruit.println("</tr>");
@@ -50,7 +50,7 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
if (!effect.getUID().contains("None")) {
String effectDesc = I18N.localiseOrBlank("binniecore.allele." + effect.getUID() + ".desc");
String loc = effectDesc.isEmpty()
? I18N.localise(AnalystConstants.BEHAVIOUR_KEY + ".effect", effect.getName())
? I18N.localise(AnalystConstants.BEHAVIOUR_KEY + ".effect", effect.getAlleleName())
: effectDesc;
new ControlText(this, new Area(4, y, width() - 8, 0), loc, TextJustification.TOP_CENTER)
@@ -85,7 +85,7 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
if (!effect2.getUID().contains("None")) {
String effectDesc2 = I18N.localiseOrBlank("binniecore.allele." + effect2.getUID() + ".desc");
String loc2 = effectDesc2.isEmpty()
? I18N.localise(AnalystConstants.BEHAVIOUR_KEY + ".effect", effect2.getName())
? I18N.localise(AnalystConstants.BEHAVIOUR_KEY + ".effect", effect2.getAlleleName())
: effectDesc2;
new ControlText(this, new Area(4, y, width() - 8, 0), loc2, TextJustification.TOP_CENTER)
@@ -51,49 +51,49 @@ public class AnalystPageMutations extends ControlAnalystPage {
if (ind instanceof IBee) {
ItemStack hive = null;
if (ExtraBeesIntegration.isLoaded()) {
if (ind.getGenome().getPrimary() == ExtraBeesIntegration.water) {
if (speciesCurrent == ExtraBeesIntegration.water) {
hive = new ItemStack(ExtraBeesIntegration.hive, 1, 0);
}
if (ind.getGenome().getPrimary() == ExtraBeesIntegration.rock) {
if (speciesCurrent == ExtraBeesIntegration.rock) {
hive = new ItemStack(ExtraBeesIntegration.hive, 1, 1);
}
if (ind.getGenome().getPrimary() == ExtraBeesIntegration.basalt) {
if (speciesCurrent == ExtraBeesIntegration.basalt) {
hive = new ItemStack(ExtraBeesIntegration.hive, 1, 2);
}
if (ind.getGenome().getPrimary() == ExtraBeesIntegration.marble) {
if (speciesCurrent == ExtraBeesIntegration.marble) {
hive = new ItemStack(ExtraBeesIntegration.hive, 1, 3);
}
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Forest.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Forest.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 1);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Meadows.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Meadows.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 2);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Modest.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Modest.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 3);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Tropical.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Tropical.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 4);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Ended.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Ended.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 5);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Wintry.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Wintry.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 6);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Marshy.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Marshy.getAllele()) {
hive = new ItemStack(Mods.Forestry.block("beehives"), 1, 7);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
hive = new ItemStack(Blocks.CHEST);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Valiant.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Valiant.getAllele()) {
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.natural")).setColor(getColor());
y += 10;
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.hive")).setColor(getColor());
y += 22;
} else if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Monastic.getAllele()) {
} else if (speciesCurrent == ForestryAllele.BeeSpecies.Monastic.getAllele()) {
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.natural")).setColor(getColor());
y += 10;
new ControlTextCentered(this, y, TextFormatting.ITALIC + I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.villager")).setColor(getColor());
@@ -102,7 +102,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
new ControlTextCentered(this, y, I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.natural")).setColor(getColor());
y += 10;
ControlItemDisplay display = new ControlItemDisplay(this, (width() - 16) / 2, y);
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
if (speciesCurrent == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
display.addTooltip(I18N.localise(AnalystConstants.MUTATIONS_KEY + ".bee.dungeon"));
} else {
display.setTooltip();
@@ -129,7 +129,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
public void initialise() {
IAlleleSpecies species0 = mutation.getAllele0();
IAlleleSpecies species2 = mutation.getAllele1();
String comb = species0.getName() + " + " + species2.getName();
String comb = species0.getAlleleName() + " + " + species2.getAlleleName();
addTooltip(comb);
String chance = getMutationColour(mutation.getBaseChance()).getCode() + (int) mutation.getBaseChance() + "% " + I18N.localise(AnalystConstants.MUTATIONS_KEY + ".chance");
if (specificChance != mutation.getBaseChance()) {
@@ -34,6 +34,6 @@ public class ControlIndividualDisplay extends ControlItemDisplay implements IToo
if (ind == null) {
return;
}
tooltip.add(ind.getGenome().getPrimary().getName());
tooltip.add(ind.getGenome().getPrimary().getAlleleName());
}
}
@@ -104,7 +104,7 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
if (this.species != null) {
switch (this.discovered) {
case Show: {
tooltip.add(this.species.getName());
tooltip.add(this.species.getAlleleName());
break;
}
case Discovered: {
@@ -17,13 +17,13 @@ class ControlSpeciesBoxOption extends ControlTextOption<IAlleleSpecies> {
private ControlDatabaseIndividualDisplay controlBee;
public ControlSpeciesBoxOption(final ControlList<IAlleleSpecies> controlList, final IAlleleSpecies option, final int y) {
super(controlList, option, option.getName(), y);
super(controlList, option, option.getAlleleName(), y);
this.setSize(new Point(this.getSize().x(), 20));
(this.controlBee = new ControlDatabaseIndividualDisplay(this, 2, 2)).setSpecies(this.getValue(), EnumDiscoveryState.Undetermined);
if (this.controlBee.discovered == EnumDiscoveryState.Discovered) {
this.controlBee.discovered = EnumDiscoveryState.Show;
}
this.textWidget.setValue((this.controlBee.discovered == EnumDiscoveryState.Show) ? option.getName() : "Undiscovered");
this.textWidget.setValue((this.controlBee.discovered == EnumDiscoveryState.Show) ? option.getAlleleName() : "Undiscovered");
if (this.controlBee.discovered == EnumDiscoveryState.Show) {
this.addAttribute(Attribute.MouseOver);
}
@@ -47,7 +47,7 @@ public class PageSpeciesOverview extends PageSpecies {
this.controlInd2.setSpecies(species, EnumDiscoveryState.Show);
final String branchBinomial = species.getBranch().getScientific();
final String branchName = species.getBranch().getName();
this.controlName.setValue(TextFormatting.UNDERLINE + species.getName());
this.controlName.setValue(TextFormatting.UNDERLINE + species.getAlleleName());
this.controlScientific.setValue(TextFormatting.ITALIC + branchBinomial + " " + species.getBinomial());
this.controlAuthority.setValue(I18N.localise("binniecore.gui.database.discovered") + ": " + TextFormatting.BOLD + species.getAuthority());
this.controlComplexity.setValue(I18N.localise("binniecore.gui.database.overview.complexity") + ": " + species.getComplexity());
@@ -62,16 +62,16 @@ public class ControlPunnett extends Control {
}
StringBuilder text = new StringBuilder();
for (IAllele allele3 : alleles) {
text.append(allele3.getName()).append(": ").append(25.0f / alleles.size()).append("%\n");
text.append(allele3.getAlleleName()).append(": ").append(25.0f / alleles.size()).append("%\n");
}
new ControlText(this, new Area(x * ControlPunnett.boxWidth, ControlPunnett.boxHeight * y, ControlPunnett.boxWidth, ControlPunnett.boxHeight), text.toString(), TextJustification.TOP_CENTER).setColor(11184810);
++y;
}
++x;
}
new ControlText(this, new Area(ControlPunnett.boxWidth, 0, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + primary1.getName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(ControlPunnett.boxWidth * 2, 0, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + secondary1.getName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(0, ControlPunnett.boxHeight, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(0, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(ControlPunnett.boxWidth, 0, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + primary1.getAlleleName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(ControlPunnett.boxWidth * 2, 0, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + secondary1.getAlleleName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(0, ControlPunnett.boxHeight, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getAlleleName(), TextJustification.TOP_CENTER).setColor(11184810);
new ControlText(this, new Area(0, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getAlleleName(), TextJustification.TOP_CENTER).setColor(11184810);
}
}