コード例 #1
0
        public Engine(IRender render, IStatisticFactory statisticFactory, IStatisticStorage statisticStorage)
        {
            if (render == null)
            {
                throw new ArgumentNullException("render");
            }

            if (statisticFactory == null)
            {
                throw new ArgumentNullException("statisticFactory");
            }

            if (statisticStorage == null)
            {
                throw new ArgumentNullException("statisticStorage");
            }

            this.Render           = render;
            this.StatisticFactory = statisticFactory;
            this.StatisticStorage = statisticStorage;

            this.State          = new StartState(this);
            this.CommandFactory = new CommandFactory(this);
            this.Statistic      = StatisticFactory.CreateStatistic();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Engine"/> class.
        /// </summary>
        /// <param name="render">The render.</param>
        /// <param name="statisticFactory">The statisticFactory.</param>
        /// <param name="statisticStorage">The statisticStorage.</param>
        public Engine(IRender render, IStatisticFactory statisticFactory, IStatisticStorage statisticStorage)
        {
            if (render == null)
            {
                throw new ArgumentNullException(nameof(render));
            }

            if (statisticFactory == null)
            {
                throw new ArgumentNullException(nameof(statisticFactory));
            }

            if (statisticStorage == null)
            {
                throw new ArgumentNullException(nameof(statisticStorage));
            }

            this.Render = render;
            this.StatisticFactory = statisticFactory;
            this.StatisticStorage = statisticStorage;

            this.State = new StartState(this);
            this.CommandFactory = new CommandFactory(this);
            this.Statistic = this.StatisticFactory.CreateStatistic();
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StatisticStorage"/> class.
        /// </summary>
        /// <param name="factory">The factory.</param>
        /// <param name="playerMementoStorage">The playerMementoStorage.</param>
        public StatisticStorage(IStatisticFactory factory, IPlayerMementoStorage playerMementoStorage)
        {
            Validator.CheckIfNull(factory, nameof(factory));

            Validator.CheckIfNull(playerMementoStorage, nameof(playerMementoStorage));

            this.Factory = factory;
            this.PlayerMementoStorage = playerMementoStorage;
        }
コード例 #4
0
        public StatisticStorage(IStatisticFactory factory, IPlayerMementoStorage playerMementoStorage)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            if (playerMementoStorage == null)
            {
                throw new ArgumentNullException("playerMementoStorage");
            }

            this.Factory = factory;
            this.PlayerMementoStorage = playerMementoStorage;
        }
コード例 #5
0
        public StatisticStorage(IStatisticFactory factory, IPlayerMementoStorage playerMementoStorage)
        {
            if(factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            if (playerMementoStorage == null)
            {
                throw new ArgumentNullException("playerMementoStorage");
            }

            this.Factory = factory;
            this.PlayerMementoStorage = playerMementoStorage;
        }
コード例 #6
0
        public StatisticService(
            IUserService userService,
            IEFRepository <Statistic> statisticRepository,
            IUnitOfWork unitOfWork,
            IStatisticFactory statisticFactory)
        {
            Guard.WhenArgument(userService, "UserService").IsNull().Throw();
            Guard.WhenArgument(statisticRepository, "StatisticRepository").IsNull().Throw();
            Guard.WhenArgument(unitOfWork, "UnitOfWork").IsNull().Throw();
            Guard.WhenArgument(statisticFactory, "StatisticFactory").IsNull().Throw();

            this.userService         = userService;
            this.statisticRepository = statisticRepository;
            this.unitOfWork          = unitOfWork;
            this.statisticFactory    = statisticFactory;
        }