public DataStatisticStorage( IDataRepository statisticStorage, IGlobalServerStatisticStorage globalStatisticStorage, IServerStatisticStorage serverStatisticStorage, IPlayerStatisticStorage playerStatisticStorage, IReportStorage reportStorage) { logger.Info("Initialize full statistic storage"); this.statisticStorage = statisticStorage; this.globalStatisticStorage = globalStatisticStorage; this.serverStatisticStorage = serverStatisticStorage; this.playerStatisticStorage = playerStatisticStorage; this.reportStorage = reportStorage; InitStatisticsProviders(); }
public virtual void Setup() { GlobalStatisticStorage = new GlobalServerStatisticStorage(); ServerStatisticStorage = new ServerStatisticStorage(GlobalStatisticStorage); PlayerStatisticStorage = new PlayerStatisticStorage(); ReportStorage = new ReportStorage(ServerStatisticStorage, PlayerStatisticStorage); DocumentStore = RavenDbStore.GetStore(new ApplicationOptions { InMemory = true, UnitTesting = true }); DataRepository = new RavenDbStorage(DocumentStore); StatisticStorage = new DataStatisticStorage( DataRepository, GlobalStatisticStorage, ServerStatisticStorage, PlayerStatisticStorage, ReportStorage); }
public ServerStatisticStorage(IGlobalServerStatisticStorage globalStatistic) { this.globalStatistic = globalStatistic; }
public ReportsModule(IReportStorage reportStorage, IGlobalServerStatisticStorage globalStatisticStorage) { this.reportStorage = reportStorage; this.globalStatisticStorage = globalStatisticStorage; }
public double AverageMatchesPerDay(IGlobalServerStatisticStorage globalStatisticStorage) { return(TotalMatchesPlayed / ((globalStatisticStorage.LastDayWithMatch - globalStatisticStorage.FirstDayWithMatch).Days + 1)); }