Пример #1
0
        public void Start()
        {
            Strategy newStrategy    = null;
            int      strategyChoice = random.Next(0, Enum.GetValues(typeof(Strategy.StrategyType)).Length);

            switch ((Strategy.StrategyType)strategyChoice)
            {
            case Strategy.StrategyType.ValidFileOpen:
                newStrategy = new ValidFileOpen();
                break;

            case Strategy.StrategyType.WhiteNoise:
                newStrategy = new WhiteNoise();
                break;

            case Strategy.StrategyType.SymbolGenerator:
                newStrategy = new SymbolGenerator();
                break;

            case Strategy.StrategyType.KeywordGenerator:
                newStrategy = new KeywordGenerator();
                break;
            }

            InitializeStrategy(newStrategy);
            OnDispatchTimer();
        }
Пример #2
0
        public void Start()
        {
            Strategy newStrategy = null;
            int strategyChoice = random.Next(0, Enum.GetValues(typeof(Strategy.StrategyType)).Length);

            switch ((Strategy.StrategyType)strategyChoice)
            {
                case Strategy.StrategyType.ValidFileOpen:
                    newStrategy = new ValidFileOpen();
                    break;
                case Strategy.StrategyType.WhiteNoise:
                    newStrategy = new WhiteNoise();
                    break;
                case Strategy.StrategyType.SymbolGenerator:
                    newStrategy = new SymbolGenerator();
                    break;
                case Strategy.StrategyType.KeywordGenerator:
                    newStrategy = new KeywordGenerator();
                    break;
            }

            InitializeStrategy(newStrategy);
            OnDispatchTimer();
        }