Add MakePackWithSchema

This commit is contained in:
Hamcha 2019-05-31 11:12:16 +02:00
parent 55a3754a23
commit c5d833db82
Signed by: hamcha
GPG key ID: A40413D21021EAEE

View file

@ -34,8 +34,14 @@ type AlternateProvider struct {
}
// MakePack makes a booster pack from a given set
// It's a shortcut to `MakePackWithSchema(set.PackSchema())`
func MakePack(set Set) Pack {
schema := set.PackSchema()
return MakePackWithSchema(schema)
}
// MakePackWithSchema makes a booster pack from a given schema
func MakePackWithSchema(schema PackSchema) Pack {
pack := make(Pack, 0)
for _, slot := range schema.Slots {
// Default provider