MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / load

Method load

modules/elections/elections.go:115–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115func (m *ElectionsModule) load() {
116 m.plug.ReadIntoStruct(`elections-state`, &m.state)
117 if m.state.Winners == nil {
118 m.state.Winners = make(map[string]Winner)
119 }
120 if m.state.Coffers == nil {
121 m.state.Coffers = make(map[string]int)
122 }
123 if m.state.TaxRates == nil {
124 m.state.TaxRates = make(map[string]int)
125 }
126 if m.state.ActiveElection != nil && m.state.ActiveElection.Votes == nil {
127 m.state.ActiveElection.Votes = make(map[int]int)
128 }
129}
130
131func (m *ElectionsModule) save() {
132 m.plug.WriteStruct(`elections-state`, m.state)

Callers

nothing calls this directly

Calls 1

ReadIntoStructMethod · 0.80

Tested by

no test coverage detected