예제 #1
0
 public UpgradeData GetRequiredResearch(UpgradeData upgrade)
 {
     if (Research_To_RequiredResearch.TryGetValue(upgrade.UpgradeId, out var id))
     {
         return(upgradeRepository.Get(id));
     }
     return(null);
 }
예제 #2
0
        private void UpdateIntel(Observation obs)
        {
            GameConstants.GameLoop = obs.GameLoop;
            GameMap.CreepAndVisibility(obs);

            if (obs.PlayerCommon != null)
            {
                Common = obs.PlayerCommon;
            }
            if (obs.Score != null)
            {
                CurrentScore = obs.Score;
            }
            if (obs.RawData.Player != null)
            {
                if (UpgradesSelf.Count != obs.RawData.Player.UpgradeIds.Count)
                {
                    UpgradesSelf = obs.RawData.Player.UpgradeIds.Select(id => upgradeRepository.Get(id)).ToList();
                }
            }
            DeadUnits(obs.RawData.Event);

            if (obs.RawData != null)
            {
                foreach (var unit in obs.RawData.Units)
                {
                    if (unit.Alliance == Alliance.Self)
                    {
                        AddUnitSelf(unit);
                    }
                    else if (unit.Alliance == Alliance.Enemy)
                    {
                        AddUnitEnemy(unit);
                    }
                    else if (unit.DisplayType == DisplayType.Visible)
                    {
                        UpdateUnitNeutral(unit);
                    }
                }
            }

            DetectEnemyRace();
        }
예제 #3
0
 void IProductionManager.QueueTech(uint upgradeId, bool lowPriority)
 => QueueTech(upgradeRepository.Get(upgradeId), lowPriority);