37 lines
803 B
Go
37 lines
803 B
Go
package models
|
|
|
|
type System struct {
|
|
Id string
|
|
Title string
|
|
Description string
|
|
Url string
|
|
Compatibility Compatibility
|
|
Download string
|
|
}
|
|
|
|
type Systems []System
|
|
|
|
func (systems Systems) GetById(id int) *System {
|
|
return &systems[id]
|
|
}
|
|
|
|
func (state *FoundryState) GetSystems() Systems {
|
|
systemsCopy := make([]System, 0, 8)
|
|
for i := range state.Systems {
|
|
system := &(state.Systems[i])
|
|
systemCopy := System{
|
|
Id: system.Id,
|
|
Title: system.Title,
|
|
Description: system.Description,
|
|
Url: system.Url,
|
|
Compatibility: Compatibility{
|
|
Minimum: system.Compatibility.Minimum,
|
|
Maximum: system.Compatibility.Maximum,
|
|
},
|
|
Download: system.Download,
|
|
}
|
|
systemsCopy = append(systemsCopy, systemCopy)
|
|
}
|
|
return systemsCopy
|
|
}
|