mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 06:24:26 +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,27 +1,22 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.texture.BinnieCoreTexture;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType>
|
||||
{
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType> {
|
||||
Texture BeeTexture;
|
||||
Texture TreeTexture;
|
||||
Texture MothTexture;
|
||||
@@ -29,24 +24,24 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
IChromosomeType chromo;
|
||||
ISpeciesRoot species;
|
||||
|
||||
public ControlChromosome(final IWidget parent, final float x, final float y) {
|
||||
public ControlChromosome(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 96.0f, 96.0f);
|
||||
this.BeeTexture = new StandardTexture(0, 0, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
this.TreeTexture = new StandardTexture(96, 0, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
this.MothTexture = new StandardTexture(96, 96, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
this.FlowerTexture = new StandardTexture(0, 96, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
this.chromo = null;
|
||||
this.species = null;
|
||||
BeeTexture = new StandardTexture(0, 0, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
TreeTexture = new StandardTexture(96, 0, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
MothTexture = new StandardTexture(96, 96, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
FlowerTexture = new StandardTexture(0, 96, 96, 96, BinnieCoreTexture.GUIBreeding);
|
||||
chromo = null;
|
||||
species = null;
|
||||
}
|
||||
|
||||
public ISpeciesRoot getRoot() {
|
||||
return this.species;
|
||||
return species;
|
||||
}
|
||||
|
||||
public void setRoot(final ISpeciesRoot root) {
|
||||
if (root != this.species) {
|
||||
this.species = root;
|
||||
this.deleteAllChildren();
|
||||
public void setRoot(ISpeciesRoot root) {
|
||||
if (root != species) {
|
||||
species = root;
|
||||
deleteAllChildren();
|
||||
if (root == Binnie.Genetics.getBeeRoot()) {
|
||||
new ControlChromoPicker(this, 28.0f, 47.0f, EnumBeeChromosome.SPECIES);
|
||||
new ControlChromoPicker(this, 28.0f, 72.0f, EnumBeeChromosome.SPEED);
|
||||
@@ -61,8 +56,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
new ControlChromoPicker(this, 83.0f, 27.0f, EnumBeeChromosome.FLOWERING);
|
||||
new ControlChromoPicker(this, 71.0f, 10.0f, EnumBeeChromosome.TERRITORY);
|
||||
new ControlChromoPicker(this, 84.0f, 54.0f, EnumBeeChromosome.EFFECT);
|
||||
}
|
||||
else if (root == Binnie.Genetics.getTreeRoot()) {
|
||||
} else if (root == Binnie.Genetics.getTreeRoot()) {
|
||||
new ControlChromoPicker(this, 48.0f, 48.0f, EnumTreeChromosome.SPECIES);
|
||||
new ControlChromoPicker(this, 43.0f, 12.0f, EnumTreeChromosome.GROWTH);
|
||||
new ControlChromoPicker(this, 43.0f, 84.0f, EnumTreeChromosome.HEIGHT);
|
||||
@@ -76,8 +70,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
new ControlChromoPicker(this, 70.0f, 34.0f, EnumTreeChromosome.MATURATION);
|
||||
new ControlChromoPicker(this, 45.0f, 67.0f, EnumTreeChromosome.GIRTH);
|
||||
new ControlChromoPicker(this, 5.0f, 70.0f, EnumTreeChromosome.FIREPROOF);
|
||||
}
|
||||
else if (root == Binnie.Genetics.getFlowerRoot()) {
|
||||
} else if (root == Binnie.Genetics.getFlowerRoot()) {
|
||||
new ControlChromoPicker(this, 35.0f, 81.0f, EnumFlowerChromosome.SPECIES);
|
||||
new ControlChromoPicker(this, 36.0f, 28.0f, EnumFlowerChromosome.PRIMARY);
|
||||
new ControlChromoPicker(this, 27.0f, 13.0f, EnumFlowerChromosome.SECONDARY);
|
||||
@@ -90,8 +83,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
new ControlChromoPicker(this, 54.0f, 80.0f, EnumFlowerChromosome.PH_TOLERANCE);
|
||||
new ControlChromoPicker(this, 41.0f, 42.0f, EnumFlowerChromosome.SAPPINESS);
|
||||
new ControlChromoPicker(this, 37.0f, 63.0f, EnumFlowerChromosome.STEM);
|
||||
}
|
||||
else if (root == Binnie.Genetics.getButterflyRoot()) {
|
||||
} else if (root == Binnie.Genetics.getButterflyRoot()) {
|
||||
new ControlChromoPicker(this, 40.0f, 40.0f, EnumButterflyChromosome.SPECIES);
|
||||
new ControlChromoPicker(this, 63.0f, 32.0f, EnumButterflyChromosome.SIZE);
|
||||
new ControlChromoPicker(this, 32.0f, 63.0f, EnumButterflyChromosome.SPEED);
|
||||
@@ -112,36 +104,36 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
|
||||
@Override
|
||||
public IChromosomeType getValue() {
|
||||
return this.chromo;
|
||||
return chromo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IChromosomeType value) {
|
||||
this.chromo = value;
|
||||
public void setValue(IChromosomeType value) {
|
||||
chromo = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
if (this.species == null) {
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
super.onRenderBackground();
|
||||
final Texture text = this.getTypeTexture();
|
||||
Texture text = getTypeTexture();
|
||||
CraftGUI.Render.texture(text, IPoint.ZERO);
|
||||
}
|
||||
|
||||
private Texture getTypeTexture() {
|
||||
if (this.species == Binnie.Genetics.getBeeRoot()) {
|
||||
return this.BeeTexture;
|
||||
if (species == Binnie.Genetics.getBeeRoot()) {
|
||||
return BeeTexture;
|
||||
}
|
||||
if (this.species == Binnie.Genetics.getTreeRoot()) {
|
||||
return this.TreeTexture;
|
||||
if (species == Binnie.Genetics.getTreeRoot()) {
|
||||
return TreeTexture;
|
||||
}
|
||||
if (this.species == Binnie.Genetics.getButterflyRoot()) {
|
||||
return this.MothTexture;
|
||||
if (species == Binnie.Genetics.getButterflyRoot()) {
|
||||
return MothTexture;
|
||||
}
|
||||
if (this.species == Binnie.Genetics.getFlowerRoot()) {
|
||||
return this.FlowerTexture;
|
||||
if (species == Binnie.Genetics.getFlowerRoot()) {
|
||||
return FlowerTexture;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user