コード例 #1
0
ファイル: LogBehavior.cs プロジェクト: troseberry/Woodlands
        void Split()
        {
            ApplySplitForce();

            LoggingActivityPlayerBehavior.UnsnapPlayer();

            int qualityAverage = QualityMinigame.CalculateAverageGrade(HomesteadStockpile.GetLogsCountAtGrade(maxQualityGrade));

            qualityAverage = Mathf.Clamp(qualityAverage, 0, maxQualityGrade.GetHashCode());

            QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

            HomesteadStockpile.UpdateFirewoodCountAtGrade(gatheredQuality, QualityMinigame.GetUngradedFirewood());

            QualityMinigame.ClearUngradedFirewood();

            Debug.Log("Gathered Grade: " + gatheredQuality);

            Invoke("PhaseOutFirewood", 5f);
        }
コード例 #2
0
    IEnumerator WaitForFirewoodGrade()
    {
        yield return(new WaitUntil(() => !QualityMinigame.IsGradeListEmpty()));

        UnsnapPlayer();

        int qualityAverage = QualityMinigame.CalculateAverageGrade(HomesteadStockpile.GetLogsCountAtGrade(QualityMinigame.GetLastMaxFirewoodGrade()));

        qualityAverage = Mathf.Clamp(qualityAverage, 0, QualityMinigame.GetLastMaxFirewoodGrade().GetHashCode());

        QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

        int ungradedCount = QualityMinigame.GetUngradedFirewood();

        HomesteadStockpile.UpdateFirewoodCountAtGrade(gatheredQuality, ungradedCount);

        QualityMinigame.ClearUngradedFirewood();

        Debug.Log("Gathered Grade: " + gatheredQuality);
        // Debug.Log("Gathered Count: " + ungradedCount);
    }
コード例 #3
0
 public void SubtractFromStockpile()
 {
     HomesteadStockpile.UpdateTreesCountAtGrade(treeGrade, -trees);
     HomesteadStockpile.UpdateLogsCountAtGrade(logGrade, -logs);
     HomesteadStockpile.UpdateFirewoodCountAtGrade(firewoodGrade, -firewood);
 }