Package forestry.api.genetics.alleles
Interface IKaryotype
public interface IKaryotype
A karyotype is the set of all chromosomes that make up a species type's genome.
It also defines what alleles are possible values for each chromosome in the genome.
The karyotype also creates a
Codec for genomes of members of this species.-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(IChromosome<?> chromosome) Checks if this karyotype contains the given type.<A extends IAllele>
Collection<A>getAlleles(IChromosome<A> chromosome) Gets the list of valid alleles for the given chromosome.com.google.common.collect.ImmutableList<IChromosome<?>><A extends IAllele>
AgetDefaultAllele(IChromosome<A> chromosome) Returns this karyotype's default allele for the chromosome.com.google.common.collect.ImmutableMap<IChromosome<?>,? extends IAllele> net.minecraft.resources.ResourceLocationcom.mojang.serialization.Codec<IGenome>IRegistryChromosome<? extends ISpecies<?>><A extends IAllele>
booleanisAlleleValid(IChromosome<A> chromosome, A allele) <A extends IAllele>
booleanisChromosomeValid(IChromosome<A> chromosome) booleanisWeaklyInherited(IChromosome<?> chromosome) A weakly inherited chromosome is a chromosome whose default allele is always overridden by non-default alleles during inheritance.intsize()
-
Method Details
-
getChromosomes
com.google.common.collect.ImmutableList<IChromosome<?>> getChromosomes()- Returns:
- All chromosomes types of this IKaryotype, in the order they were defined.
-
contains
Checks if this karyotype contains the given type. -
getSpeciesChromosome
IRegistryChromosome<? extends ISpecies<?>> getSpeciesChromosome()- Returns:
- The chromosome that determines this individual's species.
-
size
int size()- Returns:
- The number of chromosomes in this karyotype.
-
isChromosomeValid
- Returns:
- Whether given chromosome is part of this karyotype.
-
getDefaultAllele
Returns this karyotype's default allele for the chromosome. UseISpecies.getDefaultGenome()andIGenome.getActiveAllele(forestry.api.genetics.alleles.IChromosome<A>)if you know the species.- Returns:
- The default allele for the given chromosome in this karyotype.
-
isWeaklyInherited
A weakly inherited chromosome is a chromosome whose default allele is always overridden by non-default alleles during inheritance. For example, a bee's temperature tolerance- Returns:
- Whether this chromosome is "weakly inherited" or "secondary."
-
getDefaultSpecies
net.minecraft.resources.ResourceLocation getDefaultSpecies()- Returns:
- The default species for this species type.
-
isAlleleValid
- Returns:
trueif the given allele can be set for this chromosome.
-
getGenomeCodec
com.mojang.serialization.Codec<IGenome> getGenomeCodec() -
getDefaultAlleles
com.google.common.collect.ImmutableMap<IChromosome<?>,? extends IAllele> getDefaultAlleles() -
createGenomeBuilder
IGenomeBuilder createGenomeBuilder()- Returns:
- A new genome builder using this karyotype.
-
getAlleles
Gets the list of valid alleles for the given chromosome.- Type Parameters:
A- The type of allele contained by the chromosome.- Parameters:
chromosome- The chromosome to retrieve valid alleles for.- Returns:
- An immutable list of valid alleles permitted for the chromosome in this karyotype.
- Throws:
IllegalArgumentException- If the chromosome is not present in this karyotype.
-