Package forestry.api.genetics

Examples of forestry.api.genetics.IAllele


    IAlleleBoolean primaryFireproof = (IAlleleBoolean)genome.getActiveAllele(EnumTreeChromosome.FIREPROOF.ordinal());
    if (primaryFireproof.getValue())
      list.add(String.format("\u00A7c%s", StatCollector.translateToLocal("for.gui.fireresist")));

    IAllele fruit = getGenome().getActiveAllele(EnumTreeChromosome.FRUITS.ordinal());
    if(fruit != Allele.fruitNone) {
      String strike = "";
      if (!canBearFruit())
        strike = "\u00A7m";
      list.add(strike + "\u00A7aF: " + StringUtil.localize(genome.getFruitProvider().getDescription()));
View Full Code Here


    IChromosome[] parent1 = genomeOne.getChromosomes();
    IChromosome[] parent2 = genomeTwo.getChromosomes();

    IGenome genome0;
    IGenome genome1;
    IAllele allele0;
    IAllele allele1;

    if (world.rand.nextBoolean()) {
      allele0 = parent1[EnumTreeChromosome.SPECIES.ordinal()].getPrimaryAllele();
      allele1 = parent2[EnumTreeChromosome.SPECIES.ordinal()].getSecondaryAllele();
View Full Code Here

    IAlleleBeeSpecies primary = genome.getPrimary();
    IAlleleBeeSpecies secondary = genome.getSecondary();
    if (!isPureBred(EnumBeeChromosome.SPECIES.ordinal()))
      list.add("\u00A79" + StringUtil.localize("bees.hybrid").replaceAll("%PRIMARY",primary.getName()).replaceAll("%SECONDARY",secondary.getName()));

    IAllele speed = genome.getActiveAllele(EnumBeeChromosome.SPEED.ordinal());
    String customWorker = "tooltip.worker." + speed.getUnlocalizedName().replaceFirst("gui.", "");
    if (StringUtil.canTranslate(customWorker))
      list.add(StringUtil.localize(customWorker));
    else
      list.add(speed.getName() + " " + StringUtil.localize("gui.worker"));

    list.add(genome.getActiveAllele(EnumBeeChromosome.LIFESPAN.ordinal()).getName() + " " + StringUtil.localize("gui.life"));

    IAlleleTolerance tempTolerance = (IAlleleTolerance)getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal());
    list.add("\u00A7aT: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + tempTolerance.getName());
View Full Code Here

    IChromosome[] parent1 = genomeOne.getChromosomes();
    IChromosome[] parent2 = genomeTwo.getChromosomes();

    IGenome genome0;
    IGenome genome1;
    IAllele allele0;
    IAllele allele1;

    if (world.rand.nextBoolean()) {
      allele0 = parent1[EnumBeeChromosome.SPECIES.ordinal()].getPrimaryAllele();
      allele1 = parent2[EnumBeeChromosome.SPECIES.ordinal()].getSecondaryAllele();
View Full Code Here

    deprecatedAlleleMap.put(deprecatedUID, replacementAllele);
  }

  @Override
  public IAllele getAllele(String uid) {
    IAllele allele = alleleMap.get(uid);

    if (allele == null) {
      allele = deprecatedAlleleMap.get(uid);
    }
View Full Code Here

    super(chromosomes);
  }

  // NBT RETRIEVAL
  public static IAlleleBeeSpecies getSpecies(ItemStack itemStack) {
    IAllele speciesAllele = Genome.getPrimaryAllele(itemStack, EnumBeeChromosome.SPECIES);
    if (speciesAllele instanceof IAlleleBeeSpecies)
      return (IAlleleBeeSpecies)speciesAllele;
    else
      return null;
  }
View Full Code Here

    return chromosome;
  }

  public static IChromosome inheritChromosome(Random rand, IChromosome parent1, IChromosome parent2) {

    IAllele choice1;
    if (rand.nextBoolean())
      choice1 = parent1.getPrimaryAllele();
    else
      choice1 = parent1.getSecondaryAllele();

    IAllele choice2;
    if (rand.nextBoolean())
      choice2 = parent2.getPrimaryAllele();
    else
      choice2 = parent2.getSecondaryAllele();
View Full Code Here

  @Override
  public String getPrevAlleleId(String uid, World world) {
    if(!(forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid) instanceof IAlleleBeeSpecies)) {
      return getLastValidAllele(world);
    }
    IAllele lastAllele = null;
    for(IAllele allele:AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
      if(allele instanceof IAlleleBeeSpecies) {
        if(allele.getUID().equals(uid)) {
          if(lastAllele == null) {
            return "";
          }
          return lastAllele.getUID();
        } else if(isKnownAlleleId(allele.getUID(), world)) {
          lastAllele = allele;
        }
      }
    }
View Full Code Here

   * @param phase special phase of the bee.
   */
  @Override
  @SideOnly(Side.CLIENT)
  public IIcon getIconIndexForAlleleId(String uid, int phase) {
    IAllele bSpecies = forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
    if (!(bSpecies instanceof IAlleleBeeSpecies))
      bSpecies = root.getDefaultTemplate()[forestry.api.apiculture.EnumBeeChromosome.SPECIES.ordinal()];
    IAlleleBeeSpecies species = (IAlleleBeeSpecies) bSpecies;
    return species.getIcon(EnumBeeType.DRONE, phase);
  }
View Full Code Here

TOP

Related Classes of forestry.api.genetics.IAllele

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.