use of ecgberht.BehaviourTrees.Build 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);
}
Aggregations