Package forestry.api.genetics
Interface IGenome
public interface IGenome
Holds the
AllelePairs which comprise the traits of a given individual.-
Method Summary
Modifier and TypeMethodDescriptiondefault IGenomecopyWith(Map<IChromosome<?>, IAllele> alleles) Copies this genome, setting active and inactive alleles using the given map.copyWithPairs(Map<IChromosome<?>, AllelePair<?>> allelePairs) Copies this genome, setting active and inactive alleles using the given map.default <A extends IAllele>
AgetActiveAllele(IChromosome<A> chromosome) default net.minecraft.network.chat.MutableComponentgetActiveName(IBooleanChromosome chromosome) default net.minecraft.network.chat.MutableComponentgetActiveName(IFloatChromosome chromosome) default net.minecraft.network.chat.MutableComponentgetActiveName(IIntegerChromosome chromosome) default <V> net.minecraft.network.chat.MutableComponentgetActiveName(IValueChromosome<V> chromosome) default <S extends ISpecies<?>>
SNote: UseIIndividual.getSpecies()whenever possible.default booleangetActiveValue(IBooleanChromosome chromosome) default floatgetActiveValue(IFloatChromosome chromosome) default intgetActiveValue(IIntegerChromosome chromosome) default <V> VgetActiveValue(IValueChromosome<V> chromosome) <A extends IAllele>
AllelePair<A>getAllelePair(IChromosome<A> chromosomeType) Returns the allele pair containing the active and inactive alleles of the given chromosome.com.google.common.collect.ImmutableList<AllelePair<?>>com.google.common.collect.ImmutableMap<IChromosome<?>,AllelePair<?>> default <A extends IAllele>
AgetInactiveAllele(IChromosome<A> chromosome) default net.minecraft.network.chat.MutableComponentgetInactiveName(IBooleanChromosome chromosome) default net.minecraft.network.chat.MutableComponentgetInactiveName(IFloatChromosome chromosome) default net.minecraft.network.chat.MutableComponentgetInactiveName(IIntegerChromosome chromosome) default <V> net.minecraft.network.chat.MutableComponentgetInactiveName(IValueChromosome<V> chromosome) default <S extends ISpecies<?>>
SNote: UseIIndividual.getInactiveSpecies()whenever possible.default booleangetInactiveValue(IBooleanChromosome chromosome) default floatgetInactiveValue(IFloatChromosome chromosome) default intgetInactiveValue(IIntegerChromosome chromosome) default <V> VgetInactiveValue(IValueChromosome<V> chromosome) booleanbooleanisSameAlleles(IGenome other)
-
Method Details
-
getAllelePairs
com.google.common.collect.ImmutableList<AllelePair<?>> getAllelePairs()- Returns:
- A array with all chromosomes of this genome.
-
getAllelePair
Returns the allele pair containing the active and inactive alleles of the given chromosome. Uses an unchecked cast.- Returns:
- The allele pair for the given chromosome.
-
isDefaultGenome
boolean isDefaultGenome()- Returns:
trueif this genome is equal to the default genome of the species, as specified in the Karyotype.
-
getKaryotype
IKaryotype getKaryotype()- Returns:
- The karyotype of this genome. It defines the positions of the chromosomes in the array and the length of it.
-
getChromosomes
com.google.common.collect.ImmutableMap<IChromosome<?>,AllelePair<?>> getChromosomes() -
copyWith
Copies this genome, setting active and inactive alleles using the given map. If the resulting genome is the same as this genome, then no copy is made.- Parameters:
alleles- Map of alleles that should be in the copy.- Returns:
- A copy of this genome with alleles from the given map. If result is equal to this, then just returns this.
-
copyWithPairs
Copies this genome, setting active and inactive alleles using the given map. If the resulting genome is the same as this genome, then no copy is made.- Parameters:
allelePairs- Map of allele pairs that should be in the copy.- Returns:
- The new genome.
-
isSameAlleles
- Returns:
trueif this genome has the same karyotype and alleles as the other genome.
-
getActiveAllele
- Returns:
- The active allele of the chromosome with the given type.
-
getActiveValue
-
getActiveValue
-
getActiveValue
-
getActiveValue
-
getInactiveAllele
- Returns:
- The inactive allele of the chromosome with the given type.
-
getInactiveValue
-
getInactiveValue
-
getInactiveValue
-
getInactiveValue
-
getActiveName
-
getActiveName
-
getActiveName
-
getActiveName
default <V> net.minecraft.network.chat.MutableComponent getActiveName(IValueChromosome<V> chromosome) -
getInactiveName
-
getInactiveName
-
getInactiveName
-
getInactiveName
default <V> net.minecraft.network.chat.MutableComponent getInactiveName(IValueChromosome<V> chromosome) -
getActiveSpecies
Note: UseIIndividual.getSpecies()whenever possible.- Returns:
- The active species of the individual.
-
getInactiveSpecies
Note: UseIIndividual.getInactiveSpecies()whenever possible.- Returns:
- The inactive species of the individual.
-