Files
Foundry-Scrapping-API/internal/foundry/models/system.go
lbenedar d5577f10d7 init
2026-04-02 18:37:30 +03:00

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
}