private void SetStatsText(IStatsGetter stats) { maxCollectedStars = $"Max collected stars: {stats.RecordCollectedStars}"; maxEarnedScore = $"Max earned score: {stats.RecordEarnedScore}"; maxScoreMultiplierValue = $"Max score multiplier: {stats.RecordScoreMultiplierValue}"; maxLifeTime = $"Max life time: {stats.RecordLifeTime}"; totalLifeTime = $"Total life time: {stats.TotalLifeTime}"; }
public LastSessionsStatsGetter(IStatsGetter currentData, IStatsGetter receivedData) { //currentData могут быть с дефолтными значениями (т.е. пустые) RecordCollectedStars = Mathf.Max((int)currentData.RecordCollectedStars, (int)receivedData.RecordCollectedStars); RecordEarnedScore = Mathf.Max((int)currentData.RecordEarnedScore, (int)receivedData.RecordEarnedScore); RecordScoreMultiplierValue = Mathf.Max((int)currentData.RecordScoreMultiplierValue, (int)receivedData.RecordScoreMultiplierValue); RecordLifeTime = Mathf.Max((int)currentData.RecordLifeTime, (int)receivedData.RecordLifeTime); TotalLifeTime = Mathf.Max((int)currentData.TotalLifeTime, (int)receivedData.TotalLifeTime); }
public PlayerStatsData(IStatsGetter dataGetter) { if (dataGetter == null) { throw new System.ArgumentNullException(nameof(dataGetter)); } RecordCollectedStars = dataGetter.RecordCollectedStars; RecordEarnedScore = dataGetter.RecordEarnedScore; RecordScoreMultiplierValue = dataGetter.RecordScoreMultiplierValue; RecordLifeTime = dataGetter.RecordLifeTime; TotalLifeTime = dataGetter.TotalLifeTime; }
public UsedDataGetter(IDataGetter currentSessionData, IDataGetter lastSessionsData) { if (currentSessionData == null) { throw new ArgumentNullException(nameof(currentSessionData)); } if (lastSessionsData == null) { throw new ArgumentNullException(nameof(lastSessionsData)); } Id = currentSessionData.Id; usedStatsGetter = new UsedStatsGetter(currentSessionData.Stats, lastSessionsData.Stats); usedInGamePurchasesGetter = new UsedInGamePurchasesGetter(currentSessionData.InGamePurchases, lastSessionsData.InGamePurchases); }
public UsedStatsGetter(IStatsGetter currentSessionData, IStatsGetter lastSessionsData) { this.currentSessionData = currentSessionData ?? throw new ArgumentNullException(nameof(currentSessionData)); this.lastSessionsData = lastSessionsData ?? throw new ArgumentNullException(nameof(lastSessionsData)); }