Search in sources :

Example 1 with ITreeBreedingSystem

use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.

the class PageWood method onValueChanged.

@Override
public void onValueChanged(final ItemStack species) {
    this.deleteAllChildren();
    final WindowAbstractDatabase database = Window.get(this);
    new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), this.getValue().toString(), TextJustification.MIDDLE_CENTER);
    ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
    final Collection<IAlleleSpecies> trees = breedingSystem.getTreesThatHaveWood(species, database.isMaster(), database.getWorld(), database.getUsername());
    new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
Also used : ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) Area(binnie.core.gui.geometry.Area) ControlText(binnie.core.gui.controls.ControlText) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlSpeciesBox(binnie.core.gui.database.ControlSpeciesBox)

Example 2 with ITreeBreedingSystem

use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.

the class PageFruit method onValueChanged.

@Override
public void onValueChanged(final ItemStack species) {
    this.deleteAllChildren();
    final WindowAbstractDatabase database = Window.get(this);
    new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), I18N.localise("extratrees.gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MIDDLE_CENTER);
    ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
    final Collection<IAlleleSpecies> trees;
    if (this.treesThatBearFruit) {
        trees = breedingSystem.getTreesThatBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
    } else {
        trees = breedingSystem.getTreesThatCanBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
    }
    new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
Also used : ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) Area(binnie.core.gui.geometry.Area) ControlText(binnie.core.gui.controls.ControlText) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlSpeciesBox(binnie.core.gui.database.ControlSpeciesBox)

Example 3 with ITreeBreedingSystem

use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.

the class WindowArboristDatabase method addTabs.

@Override
@SideOnly(Side.CLIENT)
protected void addTabs() {
    new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.overview"));
    new PageSpeciesTreeGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.genome"));
    new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.classification"));
    new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
    new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.further"));
    new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
    new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.species"));
    new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
    this.createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
        controlListBox.setOptions(breedingSystem.getAllFruits());
        return controlListBox;
    }));
    this.createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
        controlListBox.setOptions(breedingSystem.getAllWoods());
        return controlListBox;
    }));
    this.createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this, (area, modePage) -> {
        ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
        List<ItemStack> planks = WoodManager.getAllPlankTypes().stream().map(IDesignMaterial::getStack).collect(Collectors.toList());
        controlListBox.setOptions(planks);
        return controlListBox;
    }));
    new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
    new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
    new PageWood(this.getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
    new PagePlanksOverview(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
    new PagePlanksTrees(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
}
Also used : Binnie(binnie.core.Binnie) ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) IDatabaseMode(binnie.core.gui.database.IDatabaseMode) ControlListBox(binnie.core.gui.controls.listbox.ControlListBox) ItemStack(net.minecraft.item.ItemStack) ExtraTrees(binnie.extratrees.ExtraTrees) Side(net.minecraftforge.fml.relauncher.Side) PageSpeciesOverview(binnie.core.gui.database.PageSpeciesOverview) WoodManager(binnie.extratrees.wood.WoodManager) PageSpeciesClassification(binnie.core.gui.database.PageSpeciesClassification) IWidget(binnie.core.api.gui.IWidget) ControlItemStackOption(binnie.core.gui.database.ControlItemStackOption) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) ModeWidgets(binnie.core.gui.database.ModeWidgets) IArea(binnie.core.api.gui.IArea) PageBranchSpecies(binnie.core.gui.database.PageBranchSpecies) DatabaseTab(binnie.core.gui.database.DatabaseTab) TreeManager(forestry.api.arboriculture.TreeManager) PageSpeciesResultant(binnie.core.gui.database.PageSpeciesResultant) Collectors(java.util.stream.Collectors) I18N(binnie.core.util.I18N) List(java.util.List) EntityPlayer(net.minecraft.entity.player.EntityPlayer) PageBranchOverview(binnie.core.gui.database.PageBranchOverview) PageBreeder(binnie.core.gui.database.PageBreeder) WindowAbstractDatabase(binnie.core.gui.database.WindowAbstractDatabase) ControlPage(binnie.core.gui.controls.page.ControlPage) IDesignMaterial(binnie.design.api.IDesignMaterial) PageSpeciesMutations(binnie.core.gui.database.PageSpeciesMutations) Window(binnie.core.gui.minecraft.Window) PageBranchSpecies(binnie.core.gui.database.PageBranchSpecies) IDesignMaterial(binnie.design.api.IDesignMaterial) DatabaseTab(binnie.core.gui.database.DatabaseTab) ITreeBreedingSystem(binnie.genetics.api.ITreeBreedingSystem) ControlListBox(binnie.core.gui.controls.listbox.ControlListBox) PageSpeciesMutations(binnie.core.gui.database.PageSpeciesMutations) PageSpeciesOverview(binnie.core.gui.database.PageSpeciesOverview) PageSpeciesClassification(binnie.core.gui.database.PageSpeciesClassification) List(java.util.List) PageSpeciesResultant(binnie.core.gui.database.PageSpeciesResultant) ModeWidgets(binnie.core.gui.database.ModeWidgets) PageBranchOverview(binnie.core.gui.database.PageBranchOverview) PageBreeder(binnie.core.gui.database.PageBreeder) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

WindowAbstractDatabase (binnie.core.gui.database.WindowAbstractDatabase)3 ITreeBreedingSystem (binnie.genetics.api.ITreeBreedingSystem)3 ControlText (binnie.core.gui.controls.ControlText)2 ControlSpeciesBox (binnie.core.gui.database.ControlSpeciesBox)2 Area (binnie.core.gui.geometry.Area)2 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)2 Binnie (binnie.core.Binnie)1 IArea (binnie.core.api.gui.IArea)1 IWidget (binnie.core.api.gui.IWidget)1 ControlListBox (binnie.core.gui.controls.listbox.ControlListBox)1 ControlPage (binnie.core.gui.controls.page.ControlPage)1 ControlItemStackOption (binnie.core.gui.database.ControlItemStackOption)1 DatabaseTab (binnie.core.gui.database.DatabaseTab)1 IDatabaseMode (binnie.core.gui.database.IDatabaseMode)1 ModeWidgets (binnie.core.gui.database.ModeWidgets)1 PageBranchOverview (binnie.core.gui.database.PageBranchOverview)1 PageBranchSpecies (binnie.core.gui.database.PageBranchSpecies)1 PageBreeder (binnie.core.gui.database.PageBreeder)1 PageSpeciesClassification (binnie.core.gui.database.PageSpeciesClassification)1 PageSpeciesMutations (binnie.core.gui.database.PageSpeciesMutations)1