use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.
the class Ecgberht method initHarassTree.
private void initHarassTree() {
CheckHarasser cH = new CheckHarasser("Check Harasser", gs);
CheckExplorer cE = new CheckExplorer("Check Explorer", gs);
ChooseWorkerToHarass cWTH = new ChooseWorkerToHarass("Check Worker to Harass", gs);
ChooseBuilderToHarass cWTB = new ChooseBuilderToHarass("Check Worker to Harass", gs);
CheckHarasserAttacked cHA = new CheckHarasserAttacked("Check Harasser Attacked", gs);
ChooseBuildingToHarass cBTH = new ChooseBuildingToHarass("Check Building to Harass", gs);
Explore E = new Explore("Explore", gs);
HarassWorker hW = new HarassWorker("Bother SCV", gs);
Selector bOw = new Selector("Choose Builder or Worker or Building", cWTH, cWTB, cBTH);
Sequence harassAttack = new Sequence("Harass", cHA, bOw, hW);
Sequence explorer = new Sequence("Explorer", cE, E);
Selector eOh = new Selector("Explorer or harasser", explorer, harassAttack);
Sequence harass = new Sequence("Harass", cH, eOh);
botherTree = new BehavioralTree("Harass Tree");
botherTree.addChild(harass);
}
use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.
the class Ecgberht method initBuildTree.
private static void initBuildTree() {
Build b = new Build("Build", gs);
WorkerWalkBuild wwB = new WorkerWalkBuild("worker walk build", gs);
CheckMineralWalkGoldRush cMWGR = new CheckMineralWalkGoldRush("Mineral Walk Gold Rush", gs);
ChooseNothingBuilding cNB = new ChooseNothingBuilding("Choose Nothing", gs);
ChooseExpand cE = new ChooseExpand("Choose Expansion", gs);
ChooseSupply cSup = new ChooseSupply("Choose Supply Depot", gs);
ChooseBunker cBun = new ChooseBunker("Choose Bunker", gs);
ChooseBarracks cBar = new ChooseBarracks("Choose Barracks", gs);
ChooseFactory cFar = new ChooseFactory("Choose Factory", gs);
ChoosePort cPor = new ChoosePort("Choose Star Port", gs);
ChooseScience cSci = new ChooseScience("Choose Science Facility", gs);
ChooseRefinery cRef = new ChooseRefinery("Choose Refinery", gs);
ChooseBay cBay = new ChooseBay("Choose Bay", gs);
ChooseTurret cTur = new ChooseTurret("Choose Turret", gs);
ChooseAcademy cAca = new ChooseAcademy("Choose Academy", gs);
ChooseArmory cArm = new ChooseArmory("Choose Armory", gs);
CheckResourcesBuilding crb = new CheckResourcesBuilding("Check Cash", gs);
ChoosePosition cp = new ChoosePosition("Choose Position", gs);
ChooseWorker cw = new ChooseWorker("Choose Worker", gs);
Move m = new Move("Move to chosen building position", gs);
Selector chooseBuildingBuild = new Selector("Choose Building to build", cNB, cE, cBun, cSup);
chooseBuildingBuild.addChild(cTur);
chooseBuildingBuild.addChild(cRef);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Academy))
chooseBuildingBuild.addChild(cAca);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Engineering_Bay))
chooseBuildingBuild.addChild(cBay);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Armory))
chooseBuildingBuild.addChild(cArm);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Factory))
chooseBuildingBuild.addChild(cFar);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Starport))
chooseBuildingBuild.addChild(cPor);
if (gs.getStrat().buildUnits.contains(UnitType.Terran_Science_Facility))
chooseBuildingBuild.addChild(cSci);
chooseBuildingBuild.addChild(cBar);
Sequence buildMove;
if (bw.getBWMap().mapHash().equals("83320e505f35c65324e93510ce2eafbaa71c9aa1"))
buildMove = new Sequence("BuildMove", wwB, b, chooseBuildingBuild, cp, cw, crb, m);
else if (// GoldRush
bw.getBWMap().mapHash().equals("666dd28cd3c85223ebc749a481fc281e58221e4a"))
buildMove = new Sequence("BuildMove", cMWGR, b, chooseBuildingBuild, cp, cw, crb, m);
else
buildMove = new Sequence("BuildMove", b, chooseBuildingBuild, cp, cw, crb, m);
buildTree = new BehavioralTree("Building Tree");
buildTree.addChild(buildMove);
}
use of org.iaie.btree.task.composite.Selector 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);
}
Aggregations