Ejemplo n.º 1
0
 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}";
 }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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;
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
 public UsedStatsGetter(IStatsGetter currentSessionData, IStatsGetter lastSessionsData)
 {
     this.currentSessionData = currentSessionData ?? throw new ArgumentNullException(nameof(currentSessionData));
     this.lastSessionsData   = lastSessionsData ?? throw new ArgumentNullException(nameof(lastSessionsData));
 }