first simple test for positive aspects
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package goodcalc
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Stakeholder can define a weight, which is calculated to
|
||||
// all containing themes.
|
||||
// No is the id like in the excel
|
||||
@@ -10,6 +12,17 @@ type Stakeholder struct {
|
||||
Themes []*Theme `json:"themes"`
|
||||
}
|
||||
|
||||
func (s *Stakeholder) String() string {
|
||||
var str string
|
||||
str += fmt.Sprintf("\n No: %s\n", s.No)
|
||||
str += fmt.Sprintf(" Weight: %.1f\n", s.Weight)
|
||||
str += fmt.Sprintf(" Themes: %v\n", s.Themes)
|
||||
return str
|
||||
}
|
||||
|
||||
// calcWeight takes the weight of the stakeholder level
|
||||
// and calculates that weight for each theme
|
||||
// iteration 1 inside the example table
|
||||
func (s *Stakeholder) calcWeight() {
|
||||
for _, t := range s.Themes {
|
||||
t.Calc.CalcWeight = s.Weight * t.Weight
|
||||
|
||||
Reference in New Issue
Block a user