Exemple #1
0
        public void EconomyStage(Action startNextStage)
        {
            BotRunner.Tutorial = false;
            BotRunner.HotSwap  = false;

            // Game started, the first worker will get to work
            Worker[] firstWorkers = UnitHelper.GetMyUnits <Worker>();
            foreach (Worker worker in firstWorkers)
            {
                Gather(worker);
            }

            EventForCreatingAnother();
            BattleTest.RegisterReceiveFire();
            startNextStage();
        }
Exemple #2
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();
        }