private fields for calculated values

This commit is contained in:
Andreas Schröpfer
2021-01-03 08:08:10 +01:00
parent 23214be74e
commit 9f5d258f65
6 changed files with 9 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ func (m *Matrix) String() string {
return s
}
// BalancePoints calculates the ecogood points for the matrix
func (m *Matrix) BalancePoints() int {
var balancePoints float64
m.calcWeightFactor()
@@ -105,13 +106,13 @@ func (m *Matrix) setMaxValuationPoints() {
m.forall(func(t *Theme) {
maxThemeValPoints := 0
for _, a := range t.Aspects {
a.MaxValuationPoints = m.MaxValuationPoints * int(a.Weight)
a.maxValuationPoints = m.MaxValuationPoints * int(a.Weight)
maxThemeValPoints += m.MaxValuationPoints * int(a.Weight)
}
t.Calc.MaxValuationPoints = maxThemeValPoints
for _, na := range t.NegativeAspects {
na.MaxValuationPoints = m.MaxNegValuationPoints
na.maxValuationPoints = m.MaxNegValuationPoints
}
t.NegPointsFactor = m.NegPointsFactor
t.negPointsFactor = m.NegPointsFactor
})
}