Search in sources :

Example 1 with IAlleleHandler

use of forestry.api.genetics.IAlleleHandler in project ForestryMC by ForestryMC.

the class AlleleRegistry method registerAllele.

@Override
public void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes) {
    addValidAlleleTypes(allele, chromosomeTypes);
    alleleMap.put(allele.getUID(), allele);
    if (allele instanceof IAlleleSpecies) {
        IClassification branch = ((IAlleleSpecies) allele).getBranch();
        branch.addMemberSpecies((IAlleleSpecies) allele);
    }
    for (IAlleleHandler handler : this.alleleHandlers) {
        handler.onRegisterAllele(allele);
    }
}
Also used : IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) IAlleleHandler(forestry.api.genetics.IAlleleHandler) IClassification(forestry.api.genetics.IClassification)

Aggregations

IAlleleHandler (forestry.api.genetics.IAlleleHandler)1 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)1 IClassification (forestry.api.genetics.IClassification)1