void Spinner_OnUpButtonClicked() { // Get working stat value int workingValue = workingStats.GetStatValue(selectedStat); // Working value cannot rise above maxWorkingValue and bonus cannot fall below zero if (workingValue == maxWorkingValue || bonusPool == 0) { return; } // Remove a point from pool stat and assign to working stat bonusPool -= 1; workingStats.SetStatValue(selectedStat, workingValue + 1); spinner.Value = bonusPool; UpdateStatLabels(); RaiseOnStatChanged(); }
DaggerfallStats ReadStats(BinaryReader reader) { DaggerfallStats result = new DaggerfallStats(); for (int i = 0; i < 8; i++) { result.SetStatValue(i, reader.ReadInt16()); } return(result); }