コード例 #1
0
    public void ApplyStatusChange(StatusChangeData changes)
    {
        Debug.Log($"Applied {changes}");
        _status.Merge(changes);

        // TODO: Check date limit
        if (changes.OverrideTime)
        {
            _status.CurrentTime = changes.Time;
        }
        else if (changes.Time != GameTime.zero)
        {
            EventManager.Instance.ProgressTime(changes.Time);
            _status.CurrentTime += changes.Time;
        }

        UpdateUI();
    }
コード例 #2
0
    public void Merge(StatusChangeData changes)
    {
        if (changes.OverrideMoney)
        {
            Money = changes.Money;
        }
        else
        {
            Money += changes.Money;
        }

        if (changes.OverrideEnergy)
        {
            Energy = changes.Energy;
        }
        else
        {
            Energy += changes.Energy;
        }

        if (changes.OverridePersonalHappiness)
        {
            PersonalHappiness = changes.PersonalHappiness;
        }
        else
        {
            PersonalHappiness += changes.PersonalHappiness;
        }

        if (changes.OverrideFamilyHappiness)
        {
            FamilyHappiness = changes.FamilyHappiness;
        }
        else
        {
            FamilyHappiness += changes.FamilyHappiness;
        }

        if (changes.OverrideCareer)
        {
            Career = changes.Career;
        }
        else
        {
            Career += changes.Career;
        }

        if (changes.OverrideProjectProgress)
        {
            ProjectProgress = changes.ProjectProgress;
        }
        else
        {
            ProjectProgress += changes.ProjectProgress;
        }

        if (changes.OverrideLocation && changes.Location != LocationType.Null)
        {
            Location = changes.Location;
        }
    }