Refactoring bee species (#73)

* Added *Definition for bee branches and bees

* Some refactoring for ExtraBeesSpecies

* More refactoring Bees

* Added effect to bees
Some refactoring
Added bee branch parent

* Fix Barren branch

* Fix Hostile branch

* Fix other bees

* Added person mutation condition

* Added person requirement mutation condition

* Fix change  for Jaded bee

* Drop some unused methods

* Revert Binnie logic in BreedingSystem
This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-05-20 10:50:14 -07:00
1 parent a12ad2eae3
commit 4ef41b6f62
19 files changed
+2369 -2121

No files matched your search

@@ -145,12 +145,15 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
allBranches.add(branch);
}
}
if (getSpeciesRoot().getMutations(false) != null) {
Set<IMutation> mutations = new LinkedHashSet<>();
mutations.addAll(getSpeciesRoot().getMutations(false));
// TODO Why is this necessary?
if (this == Binnie.Genetics.beeBreedingSystem) {
mutations.addAll(ExtraBeeMutation.mutations);
}
for (IMutation mutation : mutations) {
allMutations.add(mutation);
Set<IAlleleSpecies> participatingSpecies = new LinkedHashSet<>();
@@ -179,13 +182,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
return AlleleManager.alleleRegistry.isBlacklisted(allele.getUID());
}
public List<IMutation> getResultantMutations(IAlleleSpecies species, boolean includeInactive) {
if (resultantMutations.isEmpty()) {
calculateArrays();
}
return includeInactive ? allResultantMutations.get(species) : resultantMutations.get(species);
}
public List<IMutation> getResultantMutations(IAlleleSpecies species) {
if (resultantMutations.isEmpty()) {
calculateArrays();
@@ -193,13 +189,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
return resultantMutations.get(species);
}
public List<IMutation> getFurtherMutations(IAlleleSpecies species, boolean includeInactive) {
if (furtherMutations.isEmpty()) {
calculateArrays();
}
return includeInactive ? allFurtherMutations.get(species) : furtherMutations.get(species);
}
public List<IMutation> getFurtherMutations(IAlleleSpecies species) {
if (furtherMutations.isEmpty()) {
calculateArrays();
@@ -298,26 +287,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
return speciesList;
}
public List<IMutation> getDiscoveredMutations(IBreedingTracker tracker) {
List<IMutation> speciesList = new ArrayList<>();
for (IMutation species : getAllMutations()) {
if (isMutationDiscovered(species, tracker)) {
speciesList.add(species);
}
}
return speciesList;
}
public int getDiscoveredBranchMembers(IClassification branch, IBreedingTracker tracker) {
int discoveredSpecies = 0;
for (IAlleleSpecies species : branch.getMemberSpecies()) {
if (isSpeciesDiscovered(species, tracker)) {
discoveredSpecies++;
}
}
return discoveredSpecies;
}
public IIcon getUndiscoveredIcon() {
return iconUndiscovered.getIcon();
}
@@ -345,7 +314,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
discoveredSpeciesCount = 0;
totalSecretCount = 0;
discoveredSecretCount = 0;
Collection<IAlleleSpecies> discoveredSpecies = getDiscoveredSpecies(tracker);
Collection<IAlleleSpecies> allSpecies = getAllSpecies();
for (IAlleleSpecies species : allSpecies) {
@@ -388,7 +356,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
discoveredSpeciesPercentage = discoveredSpeciesCount / totalSpeciesCount;
discoveredBranchPercentage = discoveredBranchCount / totalBranchCount;
String epithet = getEpitome();
onSyncBreedingTracker(tracker);
}
@@ -1,7 +1,5 @@
package binnie.core.genetics;
import binnie.Binnie;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
@@ -73,35 +71,6 @@ public class ForestryAllele {
}
}
public enum Sappiness {
Lowest,
Lower,
Low,
Average,
High,
Higher,
Highest;
public IAllele getAllele() {
return AlleleManager.alleleRegistry.getAllele("forestry.sappiness" + toString());
}
}
public enum TreeHeight {
Smallest,
Smaller,
Small,
Average,
Large,
Larger,
Largest,
Gigantic;
public IAllele getAllele() {
return AlleleManager.alleleRegistry.getAllele("forestry.height" + ((this == TreeHeight.Average) ? "Max10" : toString()));
}
}
public enum Size {
Smallest,
Smaller,
@@ -116,58 +85,6 @@ public class ForestryAllele {
}
}
public enum Saplings {
Lowest,
Lower,
Low,
Average,
High,
Higher,
Highest;
public IAllele getAllele() {
String s = toString();
if (this == Saplings.Average) {
s = "Default";
}
if (this == Saplings.High) {
s = "Double";
}
if (this == Saplings.Higher) {
s = "Triple";
}
return AlleleManager.alleleRegistry.getAllele("forestry.saplings" + s);
}
}
public enum Yield {
Lowest,
Lower,
Low,
Average,
High,
Higher,
Highest;
public IAllele getAllele() {
return AlleleManager.alleleRegistry.getAllele("forestry.yield" + ((this == Yield.Average) ? "Default" : toString()));
}
}
public enum Maturation {
Slowest,
Slower,
Slow,
Average,
Fast,
Faster,
Fastest;
public IAllele getAllele() {
return AlleleManager.alleleRegistry.getAllele("forestry.maturation" + toString());
}
}
public enum Bool {
True,
False;
@@ -181,14 +98,6 @@ public class ForestryAllele {
}
}
public enum Growth {
Tropical;
public IAllele getAllele() {
return AlleleManager.alleleRegistry.getAllele("forestry.growth" + toString());
}
}
public enum Int {
Int1,
Int2,
@@ -205,47 +114,4 @@ public class ForestryAllele {
return AlleleManager.alleleRegistry.getAllele("forestry.i" + (ordinal() + 1) + "d");
}
}
public enum BeeSpecies {
Modest,
Noble,
Forest,
Rural,
Marshy,
Sinister,
Tropical,
Wintry,
Merry,
Austere,
Imperial,
Ended,
Meadows,
Common,
Frugal,
Unweary,
Diligent,
Majestic,
Cultivated,
Industrious,
Valiant,
Secluded,
Hermitic,
Spectral,
Exotic,
Fiendish,
Monastic,
Steadfast,
Miry,
Farmerly,
Boggy,
Demonic;
public IAlleleBeeSpecies getAllele() {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.species" + toString());
}
public IAllele[] getTemplate() {
return Binnie.Genetics.getBeeRoot().getTemplate(getAllele().getUID());
}
}
}