Package forestry.api.genetics

Examples of forestry.api.genetics.IAlleleSpecies


    public IAlleleSpecies getSpecies() {
      return logic.getSpeciesFilter(orientation, pattern, allele);
    }

    public boolean isDefined() {
      IAlleleSpecies species = logic.getSpeciesFilter(orientation, pattern, allele);
      return species != null;
    }
View Full Code Here


    @Override
    public void draw(int startX, int startY) {
      if (!isDefined())
        return;

      IAlleleSpecies species = logic.getSpeciesFilter(orientation, pattern, allele);
      GL11.glDisable(GL11.GL_LIGHTING);

      for (int i = 0; i < 3; ++i) {

        IIcon icon = ((ItemBeeGE) ForestryItem.beeDroneGE.item()).getIconFromSpecies((IAlleleBeeSpecies) species, i);
View Full Code Here

    }

    @Override
    protected String getLegacyTooltip(EntityPlayer player) {
      IAlleleSpecies species = logic.getSpeciesFilter(orientation, pattern, allele);
      if (species != null)
        return species.getName();
      else
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public void handleMouseClick(int mouseX, int mouseY, int mouseButton) {
      IAlleleSpecies change = null;
      if (mouseButton == 1)
        change = null;
      else if (getSpecies() == null) {

        for (Entry<String, IAllele> entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
View Full Code Here

    return true;
  }

  @Override
  public boolean hasEffect(ItemStack itemstack, int pass) {
    IAlleleSpecies species = getSpecies(itemstack);
    return species != null && species.hasEffect();
  }
View Full Code Here

    drawRow(text0, text1, text2, fontColor.get("gui.screen"), getColorCoding(individual.getGenome().getActiveAllele(chromosome.ordinal()).isDominant()),
        getColorCoding(individual.getGenome().getInactiveAllele(chromosome.ordinal()).isDominant()));
  }

  protected final void drawSpeciesRow(String text0, IIndividual individual, Enum<?> chromosome, String customPrimaryName, String customSecondaryName) {
    IAlleleSpecies primary = individual.getGenome().getPrimary();
    IAlleleSpecies secondary = individual.getGenome().getSecondary();

    drawLine(text0, column0);
    int columnwidth = column2 - column1 - 16;

    RenderHelper.enableStandardItemLighting();
    drawItemStack(iconStacks.get(primary.getUID()), adjustToFactor(guiLeft + column1 + columnwidth - 4), adjustToFactor(guiTop + getLineY()));
    drawItemStack(iconStacks.get(secondary.getUID()), adjustToFactor(guiLeft + column2 + columnwidth - 2), adjustToFactor(guiTop + getLineY()));
    RenderHelper.disableStandardItemLighting();

    String primaryName;
    String secondaryName;

    primaryName = customPrimaryName == null ? primary.getName() : customPrimaryName;
    secondaryName = customSecondaryName == null ? secondary.getName() : customSecondaryName;

    drawSplitLine(primaryName, column1, columnwidth, individual, chromosome, false);
    drawSplitLine(secondaryName, column2, columnwidth, individual, chromosome, true);

    newLine();
View Full Code Here

    }

    // handle old saves that have missing chromosomes
    IChromosome speciesChromosome = chromosomes[EnumTreeChromosome.SPECIES.ordinal()];
    if (speciesChromosome != null) {
      IAlleleSpecies species = (IAlleleSpecies)speciesChromosome.getActiveAllele();
      IAllele[] template = getSpeciesRoot().getTemplate(species.getUID());
      for (int i = 0; i < chromosomes.length; i++) {
        if ((chromosomes[i] == null) && (template[i] != null))
          chromosomes[i] = new Chromosome(template[i]);
      }
    }
View Full Code Here

  @Override
  public String getItemStackDisplayName(ItemStack itemstack) {
    if (!itemstack.hasTagCompound())
      return "Unknown";
    IAlleleSpecies species = getSpecies(itemstack);

    String customTreeKey = "trees.custom." + type.getName() + "." + species.getUnlocalizedName().replace("trees.species.","");
    if(StringUtil.canTranslate(customTreeKey)){
      return StringUtil.localize(customTreeKey);
    }
    return StringUtil.localize("trees.grammar." + type.getName()).replaceAll("%SPECIES", species.getName()).replaceAll("%TYPE", StringUtil.localize("trees.grammar." + type.getName() + ".type"));
  }
View Full Code Here

TOP

Related Classes of forestry.api.genetics.IAlleleSpecies

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.