コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 public StatisticsCenter(IMessageQueue mq, IStatisticsStore statisticsStore,
                         ILoggerFactory loggerFactory)
 {
     _mq = mq;
     _statisticsStore = statisticsStore;
     _logger          = loggerFactory.CreateLogger <StatisticsCenter>();
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
 public StatisticsService(ILogger <StatisticsService> logger,
                          IMessageQueue messageQueue,
                          IStatisticsStore statisticsStore)
 {
     _logger          = logger;
     _messageQueue    = messageQueue;
     _statisticsStore = statisticsStore;
 }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: Actor.cs プロジェクト: WozSoftware/BadlyDrawRogue
 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));
 }
コード例 #8
0
ファイル: Actor.cs プロジェクト: WozSoftware/BadlyDrawRogue
        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;
        }
コード例 #9
0
ファイル: Actor.cs プロジェクト: WozSoftware/BadlyDrawRogue
 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);
 }