예제 #1
0
        void WorkersCanExpand()
        {
            var baseCenter = BuildingHelper.GetMyBuildings <BaseCenter>()[0];

            if (baseCenter != null && baseCenter.CanNowProduceUnit(UnitType.Worker))
            {
                baseCenter.ProduceUnit(UnitType.Worker);
            }
            // TODO: make workers expand to other minerals over the map
            BuildingTest.FindWorkerThatGathers().MoveTo(PlaceType.MyBase.UnderRampLeft);
        }
예제 #2
0
        public static void AttackUnit(IUnit enemyUnit)
        {
            var donkeys = UnitHelper.GetMyUnits <DonkeyGun>();

            if (donkeys.Length < 2)
            {
                EnqueueFirst(new Attack(enemyUnit), BuildingTest.FindWorkerThatGathers());
                return;
            }
            foreach (var donkeyGun in UnitHelper.GetMyUnits <DonkeyGun>())
            {
                EnqueueFirst(new Attack(enemyUnit), donkeyGun);
            }
        }
예제 #3
0
        public void RunEnemyPlayerExampleTest()
        {
            Log.d(">>  Starting a Planning Phase.  <<");

            var end = new Action(() => { Log.d(">>   End of a Planning Phase.   <<"); });

            if (_enemyPlayerBotData == null)
            {
                _enemyPlayerBotData = ScriptableObject.CreateInstance <TestExamples.MyBotData>();
            }

            var battleStage = new Action(() =>
            {
                Log.d(this, "Starting Battle Stage");
                if (_enemyPlayerBattleTest == null)
                {
                    _enemyPlayerBattleTest = ScriptableObject.CreateInstance <TestExamples.BattleTest>();
                }
                _enemyPlayerBattleTest.MyBotData = _enemyPlayerBotData;
                _enemyPlayerBattleTest.BattleStage(end);
            });

            var buildingStage = new Action(() =>
            {
                Log.d(this, "Starting Building Stage");
                if (_enemyPlayerBuildingTest == null)
                {
                    _enemyPlayerBuildingTest = ScriptableObject.CreateInstance <TestExamples.BuildingTest>();
                }
                _enemyPlayerBuildingTest.MyBotData = _enemyPlayerBotData;
                _enemyPlayerBuildingTest.BuildingStage(battleStage);
            });

            var economyStage = new Action(() =>
            {
                Log.d(this, "Starting Economy Stage");
                if (_enemyPlayerEconomyTest == null)
                {
                    _enemyPlayerEconomyTest = ScriptableObject.CreateInstance <TestExamples.EconomyTest>();
                }
                _enemyPlayerEconomyTest.MyBotData = _enemyPlayerBotData;
                _enemyPlayerEconomyTest.EconomyStage(buildingStage);
            });

            economyStage();
        }