public JsonSerializer( IEnumerable <IJsonConverter> converters, ILogFactory logFactory ) { _log = logFactory.CreateForType(this); _jsonSerializer = new Newtonsoft.Json.JsonSerializer() { ConstructorHandling = JSON.ConstructorHandlingDefault, NullValueHandling = JSON.NullValueHandlingDefault, TypeNameAssemblyFormatHandling = JSON.TypeNameAssemblyFormatHandlingDefault, TypeNameHandling = JSON.TypeNameHandlingDefault, FloatFormatHandling = JSON.FloatFormatHandlingDefault, DateFormatHandling = JSON.DateFormatHandlingDefault, DateTimeZoneHandling = JSON.DateTimeZoneHandlingDefault, Formatting = JSON.FormattingDefault, }; _jsonSerializer.Converters.Add(new KeyValuePairConverter()); _jsonSerializer.Converters.Add(new StringEnumConverter()); foreach (var converter in converters) { var newtonsoftConverter = new CustomJsonConverter(converter); _jsonSerializer.Converters.Add(newtonsoftConverter); } }
public CQRSService( IGamePlayEngine gamePlayEngine, IGamePlayListener gamePlayListener, IReadCacheDataRepository readCacheDataRepository, IGameDataRepository gameDataRepository, ICqrsLogicHandler logicHandler, IEventPublisher eventPublisher, IComponentContext componentContext, ILogFactory logFactory ) : base(componentContext, logFactory) { _gamePlayEngine = gamePlayEngine; _gamePlayListener = gamePlayListener; _readCacheDataRepository = readCacheDataRepository; _gameDataRepository = gameDataRepository; _logicHandler = logicHandler; _handlers.AddRange( componentContext.ResolveAll <IHttpRequestHandler>() ); _log = logFactory.CreateForType(this); // Subscribe myself to any event eventPublisher.Attach(this); }
public RESTFulApp( IComponentContext componentContext, ILogFactory logFactory ) : base(componentContext, logFactory) { _log = logFactory.CreateForType(this); }
public StartableThread( IAppSettings appSettings, ILogFactory logFactory ) { _appSettings = appSettings; _log = logFactory.CreateForType(this); }
public RngRandom( ILogFactory logFactory ) { _log = logFactory.CreateForType(this); // _rng.GetBytes(_buffer); }
public AddPlayerCommandHandler( IGameDataRepository gameDataRepository, ILogFactory logFactory ) { _gameDataRepository = gameDataRepository; _log = logFactory.CreateForType(this); }
public GetPlayerDetailsQueryHandler( IReadCacheDataRepository readCacheDataRepository, ILogFactory logFactory ) { _readCacheDataRepository = readCacheDataRepository; _log = logFactory.CreateForType(this); }
public CQRSGamePlayerListener( IEventPublisher eventPublisher, ILogFactory logFactory ) { _eventPublisher = eventPublisher; _log = logFactory.CreateForType(this); }
public AbstractApp( IComponentContext componentContext, ILogFactory logFactory ) { _componentContext = componentContext; _localTcpPortManager = componentContext.Resolve <ILocalTcpPortManager>(); _appSettings = componentContext.Resolve <IAppSettings>(); _log = logFactory.CreateForType(this); }
public ScoreChangeEventHandler2( IReadCacheDataRepository readCacheDataRepository, IEventPublisher eventPublisher, ILogFactory logFactory ) { _readCacheDataRepository = readCacheDataRepository; _eventPublisher = eventPublisher; _log = logFactory.CreateForType(this); }
public JsonReader( Newtonsoft.Json.JsonReader jsonReader, IEnumerable <IJsonConverter> converters, ILogFactory logFactory ) { _jsonReader = jsonReader; _log = logFactory.CreateForType(this); _converters.AddRange(converters); }
public AbstractService( IComponentContext componentContext, ILogFactory logFactory ) { _logicHandler = componentContext.Resolve <ICqrsLogicHandler>(); _eventPublisher = componentContext.Resolve <IEventPublisher>(); _localTcpPortManager = componentContext.Resolve <ILocalTcpPortManager>(); _appSettings = componentContext.Resolve <IAppSettings>(); _log = logFactory.CreateForType(this); }
public GameDataRepository( ILocalDataContext localDataContext, IAppSettings appSettings, IRandom random, ILogFactory logFactory ) { _dataContext = localDataContext; _appSettings = appSettings; _random = random; _log = logFactory.CreateForType(this); }
public AbstractService( IComponentContext componentContext, ILogFactory logFactory ) { _eventPublisher = componentContext.Resolve <IEventPublisher>(); _appSettings = componentContext.Resolve <IAppSettings>(); // Subscribe myself to any event _eventPublisher.Attach(this); _log = logFactory.CreateForType(this); }
public CqrsLogicHandler( IComponentContext componentContext, IEventPublisher eventPublisher, ILogFactory logFactory ) { _componentContext = componentContext; _eventPublisher = eventPublisher; _log = logFactory.CreateForType(this); // Subscribe myself to events fired by the publisher _eventPublisher.Attach(this); }
public EventPublisher( IComponentContext componentContext, StartableThread startableThread, ILogFactory logFactory ) { _componentContext = componentContext; _thread = startableThread; _log = logFactory.CreateForType(this); _thread.Name = "EventPublisher"; _thread.ThreadLatency = TimeSpan.FromMilliseconds(150); _thread.ThreadLoop = ProcessEventQueue; }
public RESTFulService( IRESTFulGameEngineListener gameEngineListener, IGamePlayEngine gamePlayEngine, ICqrsLogicHandler logicHandler, IComponentContext componentContext, ILogFactory logFactory ) : base(componentContext, logFactory) { _gameEngineListener = gameEngineListener; _gamePlayEngine = gamePlayEngine; _logicHandler = logicHandler; _log = logFactory.CreateForType(this); }
public ConsoleService( IGamePlayEngine gamePlayEngine, IGamePlayListener gamePlayListener, IReadCacheDataRepository readCacheDataRepository, IGameDataRepository gameDataRepository, ICqrsLogicHandler logicHandler, IComponentContext componentContext, ILogFactory logFactory ) : base(componentContext, logFactory) { _gamePlayEngine = gamePlayEngine; _gamePlayListener = gamePlayListener; _readCacheDataRepository = readCacheDataRepository; _gameDataRepository = gameDataRepository; _logicHandler = logicHandler; _log = logFactory.CreateForType(this); }
public LocalTcpPortManager( IAppSettings appSettings, ILogFactory logFactory ) { _appSettings = appSettings; _log = logFactory.CreateForType(this); _items.Add(new PortRangeItem { EnvironmentName = "DEBUG", PortMin = 24000, PortMax = 24999, }); _items.Add(new PortRangeItem { EnvironmentName = "RELEASE", PortMin = 52000, PortMax = 52999, }); }
public GamePlayEngine( IAcceleratedClock clock, StartableThread startableThread, IGameDataRepository gameDataRepository, IAppSettings appSettings, IRandom random, ILogFactory logFactory ) { _clock = clock; _startableThread = startableThread; _gameDataRepository = gameDataRepository; _appSettings = appSettings; _random = random; _log = logFactory.CreateForType(this); // Define parameters for the background thread _startableThread.Name = "GameEngine"; _startableThread.ThreadLatency = TimeSpan.FromMilliseconds(250); _startableThread.ThreadLoop = RunEngine; }
public SecurityContextFactory( ILogFactory logFactory) { _log = logFactory.CreateForType(this); }