public void checkLostActions(Playfield p) { Playfield tmpPf = new Playfield(); foreach (Action a in p.playactions) { if (a.target != null && a.own != null) { a.own.own = !a.target.own; } tmpPf.doAction(a); } MiniSimulator mainTurnSimulator = new MiniSimulator(6, 3000, 0); mainTurnSimulator.setSecondTurnSimu(settings.simulateEnemysTurn, settings.secondTurnAmount); mainTurnSimulator.setPlayAround(settings.playaround, settings.playaroundprob, settings.playaroundprob2); tmpPf.checkLostAct = true; tmpPf.isLethalCheck = p.isLethalCheck; float bestval = mainTurnSimulator.DoAllMoves(tmpPf); if (bestval > p.value) { p.playactions.Clear(); p.playactions.AddRange(mainTurnSimulator.bestboard.playactions); p.value = bestval; } }
public void checkLostActions(Playfield p, bool isLethalCheck) { Playfield tmpPf = new Playfield(); foreach (Action a in p.playactions) { tmpPf.doAction(a); } MiniSimulator mainTurnSimulator = new MiniSimulator(6, 3000, 0); mainTurnSimulator.setSecondTurnSimu(settings.simulateEnemysTurn, settings.secondTurnAmount); mainTurnSimulator.setPlayAround(settings.playaround, settings.playaroundprob, settings.playaroundprob2); tmpPf.checkLostAct = true; float bestval = mainTurnSimulator.doallmoves(tmpPf, isLethalCheck); if (bestval > p.value) { p.playactions.Clear(); p.playactions.AddRange(mainTurnSimulator.bestboard.playactions); p.value = bestval; } }