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 Details

    • getChromosomes

      com.google.common.collect.ImmutableList<IChromosome<?>> getChromosomes()
      Returns:
      All chromosomes types of this IKaryotype, in the order they were defined.
    • contains

      boolean contains(IChromosome<?> chromosome)
      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

      <A extends IAllele> boolean isChromosomeValid(IChromosome<A> chromosome)
      Returns:
      Whether given chromosome is part of this karyotype.
    • getDefaultAllele

      <A extends IAllele> A getDefaultAllele(IChromosome<A> chromosome)
      Returns this karyotype's default allele for the chromosome. Use ISpecies.getDefaultGenome() and IGenome.getActiveAllele(forestry.api.genetics.alleles.IChromosome<A>) if you know the species.
      Returns:
      The default allele for the given chromosome in this karyotype.
    • isWeaklyInherited

      boolean isWeaklyInherited(IChromosome<?> chromosome)
      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

      <A extends IAllele> boolean isAlleleValid(IChromosome<A> chromosome, A allele)
      Returns:
      true if 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

      <A extends IAllele> Collection<A> getAlleles(IChromosome<A> chromosome)
      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.