internal static void Reset() { _allUnits = null; _myArmy = null; //All the bots army units. // _mySquad = null;//new List<Unit>(); _myWorkers = null; _taa = null; // OptimizedPropertiesGeneList = null; // System.Threading.Thread.Sleep(100); //System.Console.WriteLine("getFrameCount: " + SWIG.BWAPI.bwapi.Broodwar.getFrameCount()); _gameRestarted = true; Game.RestartSinglePlayerGame(); }
/// <summary> /// Add all units to separate lists. For instance will there be a list with own/my units and one for enemyUnits. /// </summary> private static void AddAllUnitsToSeparateLists() { var mySquad = new List<UnitAgent>(); foreach (var unit in _allUnits) // Game.PlayerSelf.GetUnits IS EQUAL TO MyOwn Units { if (unit.IsMine) { if (IsWorker(unit)) //Add all worker units to one workers. _myWorkers.Add(ConvertUnitToUnitAgent(unit));//new UnitAgent(unit)); else //Add all military units to one squad. { //_myArmy.Add(ConvertUnitToUnitAgent(unit)); mySquad.Add(ConvertUnitToUnitAgent(unit)); } } } _myArmy.Add(mySquad); _taa = new TacticalAssaultAgent(_myArmy[0]); //Add the only existing squad. }