Beispiel #1
0
 public void SetVariable(SC2GameState gameState)
 {
     this.gameState      = gameState;
     this.newObservation = gameState.NewObservation;
     this.gameLoop       = (int)newObservation.Observation.GameLoop;
     this.allUnits       = newObservation.Observation.RawData.Units.ToList();
     this.upgradeIDs     = newObservation.Observation.RawData.Player.UpgradeIds;
     this.enemyUnit      = GetEnemyUnits();
     this.myUnit         = GetMyUnits();
     this.baseLocations  = allUnits.FindBaseLocation();
 }
Beispiel #2
0
        private EnemyUnits GetEnemyUnits()
        {
            EnemyUnits ret = new EnemyUnits();

            foreach (Unit u in allUnits)
            {
                if (u.Alliance == Alliance.Enemy)
                {
                    ret.all.Add(u);
                    if (u.IsBaseBuilding())
                    {
                        ret.baseBuilding.Add(u);
                    }
                    else
                    {
                        if (u.IsArmyUnit())
                        {
                            ret.armyUnit.Add(u);
                        }
                    }
                }
            }
            return(ret);
        }