public UnitMove StartMiniMax() { List <SimpleUnit> simpleUnitsQueue = new List <SimpleUnit>(); foreach (UnitController unit in unitsQueue) { UnitStatsReference unitStats = new UnitStatsReference(unit.HitPoints, unit.Damage, unit.Attack, unit.Defense, unit.Initiative, unit.StepsCount); SimpleUnit simpleUnit = new SimpleUnit(unitStats, unit.CurrentNode, unit.UnitSide, unit.GetInstanceID()); simpleUnitsQueue.Add(simpleUnit); } GridState gridState = new GridState(simpleUnitsQueue, SimulationManager.instance.MoveCount, SimulationManager.instance.MoveCount); PerformMiniMax(gridState, depthSearch, -1000000, 1000000); return(bestUnitMove); }
public UnitMoveInfo(SimpleUnit unit, UnitMove unitMove, float distance) { this.unit = unit; this.unitMove = unitMove; this.distance = distance; }