示例#1
0
        public ResponseResult ExecuteSimulation()
        {
            var creator  = new StrategyCreator(_context);
            var strategy = creator.FactoryMethod(Country, Region, Strategy, ParametersDictionary);

            var responseResult = strategy.Execute();

            // TODO: log to DB here result parameters
            logger.Info("End of Simulation");
            return(responseResult);
        }
示例#2
0
        public override IShootStrategy GetShootStrategy()
        {
            var             playerInputStrategy = View.GetStrategyInput();
            StrategyCreator strategyCreator     = playerInputStrategy switch
            {
                PlayerInputStrategy.Random => new ShootStrategyRandomCreator(),
                PlayerInputStrategy.AtPoint => new ShootStrategyAtPointCreator(View.GetPointInput()),
                _ => throw new ArgumentOutOfRangeException()
            };

            return(strategyCreator?.FactoryMethod());
        }