public MethodCallBroker(IRequestBuilder requestBuilder, IRandomService service = null, IBeforeRequestCommandFactory beforeRequestCommandFactory = null, IResponseHandlerFactory responseHandlerFactory = null)
 {
     _requestBuilder = requestBuilder;
     _service = service ?? new RandomOrgApiService();
     _beforeRequestCommandFactory = beforeRequestCommandFactory;
     _responseHandlerFactory = responseHandlerFactory;
 }
        public PlaylistManager(int playedItemStackCapacity = 1000, IRandomService randomService = null)
        {
            this.randomService = randomService ?? new RandomService();
            this.items = new ObservableCollection<PlaylistItem>();
            this.readonlyItems = new ReadOnlyObservableList<PlaylistItem>(items);
            this.playedItemsStack = new PlayedItemsStack<PlaylistItem>(playedItemStackCapacity);

            this.items.CollectionChanged += ItemsCollectionChanged;
        }
Esempio n. 3
0
        public Cpu(IMemory memory, IRegisterBank registerBank, IRandomService randomService, IDisplay display)
        {
            _memory        = memory;
            _registerBank  = registerBank;
            _randomService = randomService;
            _display       = display;

            _registerBank.Initialise();
        }
Esempio n. 4
0
        public PlaylistManager(int playedItemStackCapacity = 1000, IRandomService randomService = null)
        {
            this.randomService = randomService ?? new RandomService();
            items            = new ObservableCollection <PlaylistItem>();
            Items            = new ReadOnlyObservableList <PlaylistItem>(items);
            playedItemsStack = new PlayedItemsStack <PlaylistItem>(playedItemStackCapacity);

            items.CollectionChanged += ItemsCollectionChanged;
        }
Esempio n. 5
0
 public StringPatternProcessorGod(IEvolutionStrategy evolutionStragey, IStringPatternService stringPatternService, IOptimizerConfig optimizerConfig, IRandomService randomService)
 {
     this.isInitialized        = false;
     this.evolutionStrategy    = evolutionStragey;
     this.stringPatternService = stringPatternService;
     this.optimizerConfig      = optimizerConfig;
     this.randomService        = randomService;
     this.scoreCache           = new ConcurrentDictionary <Guid, double>();
 }
        public BaseMethodTest()
        {
            Random = new Random();

            AdvisoryDelayHandler = new AdvisoryDelayHandler(new DateTimeWrap());

            if (new ConfigurationManagerWrap().GetAppSettingValue<bool>("useEmulator"))
                Service = new RandomOrgApiEmulator();
        }
Esempio n. 7
0
 public RepairKit(
     IDurabilityService durability,
     IPerkService perk,
     IRandomService random)
 {
     _durability = durability;
     _perk       = perk;
     _random     = random;
 }
Esempio n. 8
0
 public ActionFactory(IEffectRepository effectRepository, IUserService userService, IStatsRepository statsRepository, IInventoryRepository inventoryRepository, ISlackWebApi slack, IRandomService randomService, IItemRepository itemRepository)
 {
     _effectRepository    = effectRepository;
     _userService         = userService;
     _statsRepository     = statsRepository;
     _inventoryRepository = inventoryRepository;
     _slack          = slack;
     _randomService  = randomService;
     _itemRepository = itemRepository;
 }
Esempio n. 9
0
 public DeathService(IDataService data,
                     INWScript script,
                     IRandomService random,
                     IDurabilityService durability)
 {
     _data       = data;
     _           = script;
     _random     = random;
     _durability = durability;
 }
Esempio n. 10
0
 public LightningShock(INWScript script,
                       IRandomService random,
                       IPerkService perk,
                       ISkillService skill)
 {
     _       = script;
     _random = random;
     _perk   = perk;
     _skill  = skill;
 }
Esempio n. 11
0
 public ItemFactory(ISlackWebApi slack, IStatsRepository statsRepository, IInventoryRepository inventoryRepository, IUserService userService, IEventDispatcher eventDispatcher, IEffectRepository effectRepository, IRandomService randomService)
 {
     _slack               = slack;
     _statsRepository     = statsRepository;
     _inventoryRepository = inventoryRepository;
     _userService         = userService;
     _eventDispatcher     = eventDispatcher;
     _effectRepository    = effectRepository;
     _randomService       = randomService;
 }
 public ExpulsionManeuver(INWScript script,
                          IPerkService perk,
                          IRandomService random,
                          IColorTokenService color)
 {
     _       = script;
     _perk   = perk;
     _random = random;
     _color  = color;
 }
Esempio n. 13
0
 public Recover(INWScript script,
                IPerkService perk,
                IRandomService random,
                ISkillService skill)
 {
     _       = script;
     _perk   = perk;
     _random = random;
     _skill  = skill;
 }
Esempio n. 14
0
 public CasinoCommands(IUserRepository userRepository, ISlackWebApi messageSender, IChannelRepository channelRepository, IBackgroundJobClient backgroundJobClient, IItemEventDispatcher itemEventDispatcher, IStatsRepository statsRepository, IRandomService randomService)
 {
     _userRepository      = userRepository;
     _slack               = messageSender;
     _channelRepository   = channelRepository;
     _backgroundJobClient = backgroundJobClient;
     _itemEventDispatcher = itemEventDispatcher;
     _statsRepository     = statsRepository;
     _randomService       = randomService;
 }
Esempio n. 15
0
 public BlockingRecovery(INWScript script,
                         IPerkService perk,
                         IRandomService random,
                         IPlayerStatService playerStat)
 {
     _           = script;
     _perk       = perk;
     _random     = random;
     _playerStat = playerStat;
 }
Esempio n. 16
0
 public GraspingIce(INWScript script,
                    IRandomService random,
                    IPerkService perk,
                    ISkillService skill)
 {
     _       = script;
     _random = random;
     _perk   = perk;
     _skill  = skill;
 }
Esempio n. 17
0
 public MonsterService(IMonsterRepository monsterRepository, ISlackWebApi slack, IUserService userService, IInventoryRepository inventoryRepository, IRandomService randomService, IMonsterFactory monsterFactory, IChannelRepository channelRepository)
 {
     _monsterRepository   = monsterRepository;
     _slack               = slack;
     _userService         = userService;
     _inventoryRepository = inventoryRepository;
     _randomService       = randomService;
     _monsterFactory      = monsterFactory;
     _channelRepository   = channelRepository;
 }
Esempio n. 18
0
 public FarmingService(INWScript script,
                       IDataContext db,
                       IRandomService random,
                       IColorTokenService color)
 {
     _       = script;
     _db     = db;
     _random = random;
     _color  = color;
 }
Esempio n. 19
0
 public FarmingService(INWScript script,
                       IDataService data,
                       IRandomService random,
                       IColorTokenService color)
 {
     _       = script;
     _data   = data;
     _random = random;
     _color  = color;
 }
Esempio n. 20
0
        public double FullyRandomCalculate(double inputValue, IRandomService randomService, int seed)
        {
            var randomOptions = new RandomOptions
            {
                Seed       = seed,
                IsNegative = inputValue <= 0.0
            };

            return(randomService.GetRandomValue(randomOptions));
        }
Esempio n. 21
0
 public CrushingEarth(INWScript script,
                      IRandomService random,
                      IPerkService perk,
                      ISkillService skill)
 {
     _       = script;
     _random = random;
     _perk   = perk;
     _skill  = skill;
 }
Esempio n. 22
0
        public Dice(
            INWScript script,
            IRandomService random,
            IColorTokenService color)
        {
            _       = script;
            _random = random;
            _color  = color;

            GenericError = _color.Red("Please enter /dice help for more information on how to use this command.");
        }
Esempio n. 23
0
 public LanguageService(
     ISkillService skillService,
     IRandomService randomService,
     IDataService data,
     AppCache cache)
 {
     _skillService  = skillService;
     _randomService = randomService;
     _data          = data;
     _cache         = cache;
 }
Esempio n. 24
0
 public PreciseToss(
     INWScript script,
     IPerkService perk,
     IRandomService random,
     ICustomEffectService customEffect)
 {
     _perk         = perk;
     _             = script;
     _random       = random;
     _customEffect = customEffect;
 }
Esempio n. 25
0
        protected override Task DoInsertAsync <T>(T entity)
        {
            var collection = IMemoryCollectionFactory.GetOrCreateCollection <T>();

            entity.Id      = IRandomService.RandomBase24(12);
            entity.Created = ITimeService.Now;

            collection.Add(entity.CopyByJson());

            return(Task.CompletedTask);
        }
Esempio n. 26
0
 public RepairKit(
     IDurabilityService durability,
     IPerkService perk,
     IRandomService random,
     ISkillService skill)
 {
     _durability = durability;
     _perk       = perk;
     _random     = random;
     _skill      = skill;
 }
Esempio n. 27
0
 public DrillSpawnRule(
     IRandomService random,
     IResourceService resource,
     IBiowareXP2 biowareXP2,
     IColorTokenService color)
 {
     _random     = random;
     _resource   = resource;
     _biowareXP2 = biowareXP2;
     _color      = color;
 }
Esempio n. 28
0
 public DrainLife(
     INWScript script,
     IRandomService random,
     IPlayerStatService stat,
     ISkillService skill)
 {
     _       = script;
     _random = random;
     _stat   = stat;
     _skill  = skill;
 }
Esempio n. 29
0
 public CasinoCommands(IUserRepository userRepository, ISlackWebApi messageSender, IChannelRepository channelRepository, IBackgroundJobClient backgroundJobClient, IEventDispatcher eventDispatcher, IStatsRepository statsRepository, IRandomService randomService, IUserService userService, ICreditsRepository creditsRepository)
 {
     _userRepository      = userRepository;
     _slack               = messageSender;
     _channelRepository   = channelRepository;
     _backgroundJobClient = backgroundJobClient;
     _eventDispatcher     = eventDispatcher;
     _statsRepository     = statsRepository;
     _randomService       = randomService;
     _userService         = userService;
     _creditsRepository   = creditsRepository;
 }
Esempio n. 30
0
 public DeathService(IDataContext db,
                     INWScript script,
                     ISerializationService serialization,
                     IRandomService random,
                     IColorTokenService color)
 {
     _db            = db;
     _              = script;
     _serialization = serialization;
     _random        = random;
     _color         = color;
 }
Esempio n. 31
0
 public TreatmentKit(INWScript script,
                     ISkillService skill,
                     ICustomEffectService customEffect,
                     IRandomService random,
                     IPerkService perk)
 {
     _             = script;
     _skill        = skill;
     _customEffect = customEffect;
     _random       = random;
     _perk         = perk;
 }
Esempio n. 32
0
 public ForcePush(INWScript script,
                  IPerkService perk,
                  IRandomService random,
                  IPlayerStatService playerStat,
                  ISkillService skill)
 {
     _           = script;
     _perk       = perk;
     _random     = random;
     _playerStat = playerStat;
     _skill      = skill;
 }
Esempio n. 33
0
 public HealingKit(INWScript script,
                   ISkillService skill,
                   IRandomService random,
                   IPerkService perk,
                   IPlayerStatService playerStat)
 {
     _           = script;
     _skill      = skill;
     _random     = random;
     _perk       = perk;
     _playerStat = playerStat;
 }
Esempio n. 34
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="randomService"><see cref="IRandomService"/> to use to get random values.  Defaults to <see cref="RandomOrgApiService"/></param>
        public UsageMethod(IRandomService randomService = null)
        {
            _randomService = randomService ?? new RandomOrgApiService();

            // We need to keep this separate so we can retrieve the list of values that are returned from to the caller
            _responseParser = new JsonResponseParserFactory(new UsageResponseParser());

            _responseHandlerFactory = new ResponseHandlerFactory(
                new ErrorHandlerThrowException(new ErrorParser()),
                _responseParser
            );
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="advisoryDelayHandler">
        /// Class which handles the apprioriate delay before the request is called.
        /// It is required that this class be passed into the method because the same instance of the <see cref="AdvisoryDelayHandler"/> must be passed in on every request.
        /// </param>
        /// <param name="randomService"><see cref="IRandomService"/> to use to get random values.  Defaults to <see cref="RandomOrgApiService"/></param>
        public StringSignedMethod(AdvisoryDelayHandler advisoryDelayHandler, IRandomService randomService = null) : base(advisoryDelayHandler, randomService)
        {
            var verifySignatureHandler = new VerifySignatureHandler(RandomService);

            BeforeRequestCommandFactory = new BeforeRequestCommandFactory(advisoryDelayHandler, verifySignatureHandler);

            ResponseHandlerFactory = new ResponseHandlerFactory(
                new ErrorHandlerThrowException(new ErrorParser()),
                verifySignatureHandler,
                advisoryDelayHandler,
                new VerifyIdResponseHandler(),
                ResponseParser
            );
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="advisoryDelayHandler">
        /// Class which handles the apprioriate delay before the request is called.
        /// It is required that this class be passed into the method because the same instance of the <see cref="AdvisoryDelayHandler"/> must be passed in on every request.
        /// </param>
        /// <param name="randomService"><see cref="IRandomService"/> to use to get random values.  Defaults to <see cref="RandomOrgApiService"/></param>
        public BlobSignedMethod(AdvisoryDelayHandler advisoryDelayHandler, IRandomService randomService = null) : base(advisoryDelayHandler, randomService)
        {
            // We just need to setup the Verification Signature class, other than that everything else is the same.
            var verifySignatureHandler = new VerifySignatureHandler(RandomService);

            BeforeRequestCommandFactory = new BeforeRequestCommandFactory(advisoryDelayHandler, verifySignatureHandler);

            ResponseHandlerFactory = new ResponseHandlerFactory(
                new ErrorHandlerThrowException(new ErrorParser()),
                verifySignatureHandler,
                advisoryDelayHandler,
                new VerifyIdResponseHandler(),
                ResponseParser
            );
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="advisoryDelayHandler">
        /// Class which handles the apprioriate delay before the request is called.
        /// It is required that this class be passed into the method because the same instance of the <see cref="AdvisoryDelayHandler"/> must be passed in on every request.
        /// </param>
        /// <param name="randomService"><see cref="IRandomService"/> to use to get random values.  Defaults to <see cref="RandomOrgApiService"/></param>
        public UuidBasicMethod(AdvisoryDelayHandler advisoryDelayHandler, IRandomService randomService = null)
        {
            RandomService = randomService ?? new RandomOrgApiService();
            RequestBuilder = new JsonRequestBuilder(new UuidJsonRequestBuilder());

            BeforeRequestCommandFactory = new BeforeRequestCommandFactory(advisoryDelayHandler);

            // We need to keep this separate so we can retrieve the list of values that are returned from to the caller
            ResponseParser = new JsonResponseParserFactory(new UuidResponseParser());

            ResponseHandlerFactory = new ResponseHandlerFactory(
                new ErrorHandlerThrowException(new ErrorParser()),
                advisoryDelayHandler,
                new VerifyIdResponseHandler(),
                ResponseParser
            );
        }
 public VerifySignatureHandler(IRandomService service = null)
 {
     _service = service ?? new RandomOrgApiService();
 }
Esempio n. 39
0
 public static void Provide(IRandomService service)
 {
     randomService = service == null ? new NullRandomService() : service;
 }