public static RoatetDecisionQuery RotateDecisionTree() { //Decision 0 var trunk = new RoatetDecisionQuery { Title = "Is enemy team turn", Test = (game) => (game.OurTeam.BanedChampions.Count + game.EnemyTeam.BanedChampions.Count + game.OurTeam.TeamMembers.Count + game.EnemyTeam.TeamMembers.Count) % 2 == 0 ^ game.FirstMove, Positive = new RotateDecisionResult { rotate = Rotate.enemyTurn }, Negative = new RotateDecisionResult { rotate = Rotate.ourTurn } }; return(trunk); }
void rotateBPDecision(Game game) { Rotate rotate; BPPhase bpPhase; Instruction instruction = new Instruction(); var trunk_rotate = RoatetDecisionQuery.RotateDecisionTree(); trunk_rotate.Evaluate(game); rotate = RotateDecisionResult.Rotate; var trunk_bpPhase = BPPhaseDecisionQuery.BPPhaseDecisionTree(); trunk_bpPhase.Evaluate(game); bpPhase = BPPhaseDecisionResult.BPPhase; game.BpPhase = bpPhase; instruction.rotate = rotate; instruction.bPPhase = bpPhase; game.instruction = instruction; }