mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 03:49:07 +00:00
Improve code readability in binnie.genetics package
Drop unused (empty) method MachinePackage#register() from all classes
This commit is contained in:
1 parent
856f08b752
commit
730043ba9c
112 files changed
+4354
-4697
No files matched your search
@@ -1,41 +1,36 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
|
||||
public class AnalystPageGenome extends ControlAnalystPage
|
||||
{
|
||||
public class AnalystPageGenome extends ControlAnalystPage {
|
||||
boolean active;
|
||||
|
||||
public AnalystPageGenome(final IWidget parent, final IArea area, final boolean active, final IIndividual ind) {
|
||||
public AnalystPageGenome(IWidget parent, IArea area, boolean active, IIndividual ind) {
|
||||
super(parent, area);
|
||||
this.active = active;
|
||||
this.setColor(26265);
|
||||
setColor(26265);
|
||||
int y = 4;
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + this.getTitle()).setColor(this.getColor());
|
||||
new ControlTextCentered(this, y, EnumChatFormatting.UNDERLINE + getTitle()).setColor(getColor());
|
||||
y += 16;
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind.getClass());
|
||||
final BreedingSystem system = Binnie.Genetics.getSystem(root);
|
||||
final Control scaled = new Control(this, 0.0f, y, 0.0f, 0.0f) {
|
||||
ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind.getClass());
|
||||
BreedingSystem system = Binnie.Genetics.getSystem(root);
|
||||
Control scaled = new Control(this, 0.0f, y, 0.0f, 0.0f) {
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
GL11.glPushMatrix();
|
||||
@@ -48,19 +43,19 @@ public class AnalystPageGenome extends ControlAnalystPage
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
};
|
||||
for (final IChromosomeType chromo : system.getActiveKaryotype()) {
|
||||
final IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
|
||||
final String alleleName = system.getAlleleName(chromo, allele);
|
||||
final float height = CraftGUI.Render.textHeight(alleleName, this.w() / 2.0f - 2.0f);
|
||||
new ControlText(scaled, new IArea(0.0f, y + (height - 9.0f) / 2.0f, this.w() / 2.0f - 2.0f, 0.0f), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColor(this.getColor());
|
||||
new ControlText(scaled, new IArea(this.w() / 2.0f + 2.0f, y, this.w() / 2.0f - 2.0f, 0.0f), alleleName, TextJustification.TopLeft).setColor(this.getColor());
|
||||
for (IChromosomeType chromo : system.getActiveKaryotype()) {
|
||||
IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
|
||||
String alleleName = system.getAlleleName(chromo, allele);
|
||||
float height = CraftGUI.Render.textHeight(alleleName, w() / 2.0f - 2.0f);
|
||||
new ControlText(scaled, new IArea(0.0f, y + (height - 9.0f) / 2.0f, w() / 2.0f - 2.0f, 0.0f), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColor(getColor());
|
||||
new ControlText(scaled, new IArea(w() / 2.0f + 2.0f, y, w() / 2.0f - 2.0f, 0.0f), alleleName, TextJustification.TopLeft).setColor(getColor());
|
||||
y += (int) (3.0f + height);
|
||||
}
|
||||
this.setSize(new IPoint(this.w(), y + 8));
|
||||
setSize(new IPoint(w(), y + 8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return (this.active ? "Active" : "Inactive") + " Genome";
|
||||
return (active ? "Active" : "Inactive") + " Genome";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user