mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
Improve code readability in binnie.botany package
This commit is contained in:
1 parent
e05bf8bb7b
commit
b609d6688f
93 files changed
+3594
-3838
No files matched your search
@@ -1,27 +1,22 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IFlowerMutation;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IFlowerMutation;
|
||||
public class FlowerMutation implements IFlowerMutation {
|
||||
protected IAlleleFlowerSpecies allele0;
|
||||
protected IAlleleFlowerSpecies allele1;
|
||||
protected IAllele[] template;
|
||||
protected int chance;
|
||||
|
||||
public class FlowerMutation implements IFlowerMutation
|
||||
{
|
||||
IAlleleFlowerSpecies allele0;
|
||||
IAlleleFlowerSpecies allele1;
|
||||
IAllele[] template;
|
||||
int chance;
|
||||
|
||||
FlowerMutation(final IAlleleFlowerSpecies allele0, final IAlleleFlowerSpecies allele1, final IAllele[] template, final int chance) {
|
||||
FlowerMutation(IAlleleFlowerSpecies allele0, IAlleleFlowerSpecies allele1, IAllele[] template, int chance) {
|
||||
this.allele0 = allele0;
|
||||
this.allele1 = allele1;
|
||||
this.template = template;
|
||||
@@ -30,32 +25,33 @@ public class FlowerMutation implements IFlowerMutation
|
||||
|
||||
@Override
|
||||
public IAlleleFlowerSpecies getAllele0() {
|
||||
return this.allele0;
|
||||
return allele0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleFlowerSpecies getAllele1() {
|
||||
return this.allele1;
|
||||
return allele1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele[] getTemplate() {
|
||||
return this.template;
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBaseChance() {
|
||||
return this.chance;
|
||||
return chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.allele0.getUID()) || allele.getUID().equals(this.allele1.getUID());
|
||||
public boolean isPartner(IAllele allele) {
|
||||
return allele.getUID().equals(allele0.getUID())
|
||||
|| allele.getUID().equals(allele1.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.allele0.getUID()) ? this.allele1 : this.allele0;
|
||||
public IAllele getPartner(IAllele allele) {
|
||||
return allele.getUID().equals(allele0.getUID()) ? allele1 : allele0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,15 +60,15 @@ public class FlowerMutation implements IFlowerMutation
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
public float getChance(IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
if (allele0 == null || allele1 == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) {
|
||||
return this.getBaseChance();
|
||||
return getBaseChance();
|
||||
}
|
||||
if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) {
|
||||
return this.getBaseChance();
|
||||
return getBaseChance();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -84,6 +80,6 @@ public class FlowerMutation implements IFlowerMutation
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
return new ArrayList<String>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user