/// <summary> /// 构造方法 /// </summary> /// <param name="eventBus">消息队列接口</param> /// <param name="statisticsStore">统计存储接口</param> /// <param name="logger">日志接口</param> public StatisticsCenter(IEventBus eventBus, IStatisticsStore statisticsStore, ILogger <StatisticsCenter> logger) { _eventBus = eventBus; _statisticsStore = statisticsStore; _logger = logger; }
/// <summary> /// 构造方法 /// </summary> /// <param name="mq">消息队列接口</param> /// <param name="statisticsStore">统计存储接口</param> /// <param name="logger">日志接口</param> public StatisticsCenter(IMessageQueue mq, IStatisticsStore statisticsStore, ILogger <StatisticsCenter> logger) { _mq = mq; _statisticsStore = statisticsStore; _logger = logger; }
public StatisticsCenter(IMessageQueue mq, IStatisticsStore statisticsStore, ILoggerFactory loggerFactory) { _mq = mq; _statisticsStore = statisticsStore; _logger = loggerFactory.CreateLogger <StatisticsCenter>(); }
/// <summary> /// 构造方法 /// </summary> /// <param name="eventBus">消息队列接口</param> /// <param name="options"></param> /// <param name="statisticsStore">统计存储接口</param> /// <param name="logger">日志接口</param> public StatisticsCenter(IEventBus eventBus, SpiderOptions options, IStatisticsStore statisticsStore, ILogger <StatisticsCenter> logger) { _options = options; _eventBus = eventBus; _statisticsStore = statisticsStore; _logger = logger; }
public StatisticsService(ILogger <StatisticsService> logger, IMessageQueue messageQueue, IStatisticsStore statisticsStore) { _logger = logger; _messageQueue = messageQueue; _statisticsStore = statisticsStore; }
private static void Validate( Actor instance, long?id = null, ActorTypes?actorType = null, string name = null, IStatisticsStore stats = null, HitPoints hp = null, IThingStore things = null) { Assert.AreEqual(id ?? Id, instance.Id); Assert.AreEqual(actorType ?? ActorType, instance.ActorType); Assert.AreEqual(name ?? Name, instance.Name); Assert.AreSame(stats ?? Stats, instance.Statistics); Assert.AreSame(hp ?? Hp, instance.HitPoints); Assert.AreSame(things ?? Things, instance.Things); }
public static Actor Create( long id, ActorTypes actorType, string name, IStatisticsStore statistics, HitPoints hitPoints, IThingStore things) { return (new Actor( id, actorType, name, statistics, hitPoints, things)); }
private Actor( long id, ActorTypes actorType, string name, IStatisticsStore statistics, HitPoints hitPoints, IThingStore things) { Debug.Assert(name != null); Debug.Assert(statistics != null); Debug.Assert(hitPoints != null); Debug.Assert(things != null); _id = id; _actorType = actorType; _name = name; _statistics = statistics; _hitPoints = hitPoints; _things = things; }
public Actor With( long?id = null, ActorTypes?actorType = null, string name = null, IStatisticsStore statistics = null, HitPoints hitPoints = null, IThingStore things = null) { return (id.HasValue || actorType.HasValue || name != null || statistics != null || hitPoints != null || things != null ? new Actor( id ?? _id, actorType ?? _actorType, name ?? _name, statistics ?? _statistics, hitPoints ?? _hitPoints, things ?? _things) : this); }