コード例 #1
0
        /// <summary>
        /// Retourne tous les RobotAction de la MainStrategy et des sous stratégies
        /// </summary>
        /// <returns>une liste de RobotAction ou null si la stratégie n'est pas définie</returns>
        public List <RobotAction> GetAllRobotAction()
        {
            List <RobotAction> Ret = null;

            if (_subStrategies != null)
            {
                foreach (SubStrategy currentSubStrategy in _subStrategies)
                {
                    if (currentSubStrategy.GetAllActions() != null)
                    {
                        foreach (RobotAction currentRobotAction in currentSubStrategy.GetAllActions())
                        {
                            if (Ret == null)
                            {
                                Ret = new List <RobotAction>();
                            }

                            Ret.Add(currentRobotAction);
                        }
                    }
                }
            }

            return(Ret);
        }
コード例 #2
0
        /// <summary>
        /// Récupère toutes les substratégies
        /// </summary>
        /// <returns>Liste de tous les substrategies</returns>
        public List <SubStrategy> GetAllSubStrategy()
        {
            List <SubStrategy> Ret = null;

            if (_subStrategies != null)
            {
                foreach (SubStrategy currentSubStrategy in _subStrategies)
                {
                    if (currentSubStrategy.Name != PrivateConst.mainStrategyName)
                    {
                        if (Ret == null)
                        {
                            Ret = new List <SubStrategy>();
                        }

                        Ret.Add(currentSubStrategy);
                    }
                }
            }

            return(Ret);
        }