Interface IGenomeBuilder


public interface IGenomeBuilder
Used to create a genome. Alleles are inline values (Allele); reference chromosomes accept a ResourceLocation which is resolved (with the value's default dominance) at apply time.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    default void
    set(IChromosome<Boolean> chromosome, boolean value)
    Shortcut for setting a dominant boolean allele.
    void
    set(IChromosome<net.minecraft.resources.ResourceLocation> chromosome, net.minecraft.resources.ResourceLocation id)
    Sets a reference chromosome (species, flower type, effect, ...) by the referenced value's ID.
    <V> void
    set(IChromosome<V> chromosome, Allele<V> allele)
    Sets both the active and inactive allele for the chromosome.
    <V> void
    setActive(IChromosome<V> chromosome, Allele<V> allele)
    Sets the active (expressed) allele for the chromosome.
    <V> void
    setInactive(IChromosome<V> chromosome, Allele<V> allele)
    Sets the inactive (non-expressed) allele for the chromosome.
    void
    Sets the remaining unset chromosomes to their karyotype defaults.
    default void
    setUnchecked(IChromosome chromosome, AllelePair allele)
     
  • Method Details

    • set

      default void set(IChromosome<Boolean> chromosome, boolean value)
      Shortcut for setting a dominant boolean allele.
    • setUnchecked

      default void setUnchecked(IChromosome chromosome, AllelePair allele)
    • set

      <V> void set(IChromosome<V> chromosome, Allele<V> allele)
      Sets both the active and inactive allele for the chromosome.
    • set

      void set(IChromosome<net.minecraft.resources.ResourceLocation> chromosome, net.minecraft.resources.ResourceLocation id)
      Sets a reference chromosome (species, flower type, effect, ...) by the referenced value's ID. The value's declared dominance is resolved at apply time.
    • setActive

      <V> void setActive(IChromosome<V> chromosome, Allele<V> allele)
      Sets the active (expressed) allele for the chromosome.
    • setInactive

      <V> void setInactive(IChromosome<V> chromosome, Allele<V> allele)
      Sets the inactive (non-expressed) allele for the chromosome.
    • build

      IGenome build()
      Returns:
      A new genome. Later modifications to this builder will not affect the returned genome.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if no chromosomes were set in this genome.
    • setRemainingDefault

      void setRemainingDefault()
      Sets the remaining unset chromosomes to their karyotype defaults.