Search in sources :

Example 11 with BehavioralTree

use of org.iaie.btree.BehavioralTree in project Ecgberht by Jabbo16.

the class Ecgberht method initAddonBuildTree.

private static void initAddonBuildTree() {
    BuildAddon bA = new BuildAddon("Build Addon", gs);
    CheckResourcesAddon cRA = new CheckResourcesAddon("Check Resources Addon", gs);
    ChooseComsatStation cCS = new ChooseComsatStation("Choose Comsat Station", gs);
    ChooseMachineShop cMS = new ChooseMachineShop("Choose Machine Shop", gs);
    ChooseTower cT = new ChooseTower("Choose Control Tower", gs);
    Selector ChooseAddon = new Selector("Choose Addon");
    if (gs.getStrat().buildAddons.contains(UnitType.Terran_Machine_Shop))
        ChooseAddon.addChild(cMS);
    if (gs.getStrat().buildAddons.contains(UnitType.Terran_Comsat_Station))
        ChooseAddon.addChild(cCS);
    if (gs.getStrat().buildAddons.contains(UnitType.Terran_Control_Tower))
        ChooseAddon.addChild(cT);
    Sequence Addon = new Sequence("Addon", ChooseAddon, cRA, bA);
    addonBuildTree = new BehavioralTree("Addon Build Tree");
    addonBuildTree.addChild(Addon);
}
Also used : Sequence(org.iaie.btree.task.composite.Sequence) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Example 12 with BehavioralTree

use of org.iaie.btree.BehavioralTree in project Ecgberht by Jabbo16.

the class Ecgberht method initRepairTree.

private void initRepairTree() {
    CheckBuildingFlames cBF = new CheckBuildingFlames("Check building in flames", gs);
    ChooseRepairer cR = new ChooseRepairer("Choose Repairer", gs);
    Repair R = new Repair("Repair Building", gs);
    Sequence Repair = new Sequence("Repair", cBF, cR, R);
    repairTree = new BehavioralTree("RepairTree");
    repairTree.addChild(Repair);
}
Also used : ChooseRepairer(ecgberht.BehaviourTrees.Repair.ChooseRepairer) CheckBuildingFlames(ecgberht.BehaviourTrees.Repair.CheckBuildingFlames) Sequence(org.iaie.btree.task.composite.Sequence) Repair(ecgberht.BehaviourTrees.Repair.Repair) BehavioralTree(org.iaie.btree.BehavioralTree)

Aggregations

BehavioralTree (org.iaie.btree.BehavioralTree)12 Sequence (org.iaie.btree.task.composite.Sequence)12 Selector (org.iaie.btree.task.composite.Selector)8 AddonBuild (ecgberht.BehaviourTrees.AddonBuild)1 Build (ecgberht.BehaviourTrees.Build)1 CheckBuildingsLot (ecgberht.BehaviourTrees.BuildingLot.CheckBuildingsLot)1 ChooseBlotWorker (ecgberht.BehaviourTrees.BuildingLot.ChooseBlotWorker)1 ChooseBuildingLot (ecgberht.BehaviourTrees.BuildingLot.ChooseBuildingLot)1 FinishBuilding (ecgberht.BehaviourTrees.BuildingLot.FinishBuilding)1 CheckPerimeter (ecgberht.BehaviourTrees.Defense.CheckPerimeter)1 ChooseDefensePosition (ecgberht.BehaviourTrees.Defense.ChooseDefensePosition)1 SendDefenders (ecgberht.BehaviourTrees.Defense.SendDefenders)1 CollectGas (ecgberht.BehaviourTrees.Recollection.CollectGas)1 CollectMineral (ecgberht.BehaviourTrees.Recollection.CollectMineral)1 FreeWorker (ecgberht.BehaviourTrees.Recollection.FreeWorker)1 CheckBuildingFlames (ecgberht.BehaviourTrees.Repair.CheckBuildingFlames)1 ChooseRepairer (ecgberht.BehaviourTrees.Repair.ChooseRepairer)1 Repair (ecgberht.BehaviourTrees.Repair.Repair)1 CheckScan (ecgberht.BehaviourTrees.Scanner.CheckScan)1 Scan (ecgberht.BehaviourTrees.Scanner.Scan)1