mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 11:29:23 +00:00
start 1.10.2
This commit is contained in:
1 parent
f969f63b66
commit
6a7c4bf67d
826 files changed
+60550
-63758
No files matched your search
@@ -1,68 +1,61 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.craftgui.mod.database;
|
||||
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import java.util.List;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.controls.listbox.ControlList;
|
||||
import binnie.craftgui.controls.listbox.ControlListBox;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import binnie.craftgui.controls.listbox.ControlListBox;
|
||||
|
||||
class ControlMutationBox extends ControlListBox<IMutation>
|
||||
{
|
||||
private int index;
|
||||
private Type type;
|
||||
private IAlleleSpecies species;
|
||||
import java.util.List;
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final IMutation value, final int y) {
|
||||
return new ControlMutationItem(((ControlScrollableContent<ControlList<IMutation>>) this).getContent(), value, this.species, y);
|
||||
}
|
||||
class ControlMutationBox extends ControlListBox<IMutation> {
|
||||
private int index;
|
||||
private Type type;
|
||||
private IAlleleSpecies species;
|
||||
|
||||
public ControlMutationBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
super(parent, x, y, width, height, 12.0f);
|
||||
this.species = null;
|
||||
this.type = type;
|
||||
}
|
||||
@Override
|
||||
public IWidget createOption(final IMutation value, final int y) {
|
||||
return new ControlMutationItem(((ControlScrollableContent<ControlList<IMutation>>) this).getContent(), value, this.species, y);
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleSpecies species) {
|
||||
if (species != this.species) {
|
||||
this.species = species;
|
||||
this.index = 0;
|
||||
this.movePercentage(-100.0f);
|
||||
final BreedingSystem system = ((WindowAbstractDatabase) this.getSuperParent()).getBreedingSystem();
|
||||
final List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
if (species != null) {
|
||||
if (this.type == Type.Resultant) {
|
||||
this.setOptions(system.getResultantMutations(species));
|
||||
}
|
||||
else {
|
||||
final List<IMutation> mutations = system.getFurtherMutations(species);
|
||||
int i = 0;
|
||||
while (i < mutations.size()) {
|
||||
final IMutation mutation = mutations.get(i);
|
||||
if (!discovered.contains(mutations) && !((IAlleleSpecies) mutation.getTemplate()[0]).isCounted()) {
|
||||
mutations.remove(i);
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
this.setOptions(mutations);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public ControlMutationBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
super(parent, x, y, width, height, 12.0f);
|
||||
this.species = null;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
enum Type
|
||||
{
|
||||
Resultant,
|
||||
Further;
|
||||
}
|
||||
public void setSpecies(final IAlleleSpecies species) {
|
||||
if (species != this.species) {
|
||||
this.species = species;
|
||||
this.index = 0;
|
||||
this.movePercentage(-100.0f);
|
||||
final BreedingSystem system = ((WindowAbstractDatabase) this.getSuperParent()).getBreedingSystem();
|
||||
final List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
if (species != null) {
|
||||
if (this.type == Type.Resultant) {
|
||||
this.setOptions(system.getResultantMutations(species));
|
||||
} else {
|
||||
final List<IMutation> mutations = system.getFurtherMutations(species);
|
||||
int i = 0;
|
||||
while (i < mutations.size()) {
|
||||
final IMutation mutation = mutations.get(i);
|
||||
if (!discovered.contains(mutations) && !((IAlleleSpecies) mutation.getTemplate()[0]).isCounted()) {
|
||||
mutations.remove(i);
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
this.setOptions(mutations);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum Type {
|
||||
Resultant,
|
||||
Further;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user