Inheritance: RTSEngine.Algorithms.ACBudgetedTask
Exemplo n.º 1
0
        private void AddTask(GameState s, RTSBuilding building)
        {
            // Init The Building
            if (building.ActionController != null)
            {
                building.ActionController.Init(s, this, building.Data.ActionControllerInitArgs);
            }
            for (int i = 0; i < building.ButtonControllers.Count; i++)
            {
                building.ButtonControllers[i].Init(s, this, building.Data.DefaultButtonControllerInitArgs[i]);
            }

            var btu = new BTaskBuildingDecision(s, building);

            building.OnDestruction += (o) => {
                tbEntityDecisions.RemoveTask(btu);
            };
            tbEntityDecisions.AddTask(btu);
        }
        private void AddTask(GameState s, RTSBuilding building)
        {
            // Init The Building
            if(building.ActionController != null) building.ActionController.Init(s, this, building.Data.ActionControllerInitArgs);
            for(int i = 0; i < building.ButtonControllers.Count; i++)
                building.ButtonControllers[i].Init(s, this, building.Data.DefaultButtonControllerInitArgs[i]);

            var btu = new BTaskBuildingDecision(s, building);
            building.OnDestruction += (o) => {
                tbEntityDecisions.RemoveTask(btu);
            };
            tbEntityDecisions.AddTask(btu);
        }