27 lines
533 B
Go
27 lines
533 B
Go
|
package draft
|
||
|
|
||
|
// Pod is a group of players drafting packs/cubes
|
||
|
type Pod struct {
|
||
|
Players []*Player
|
||
|
}
|
||
|
|
||
|
// Player is a single player partecipating in a pod
|
||
|
type Player struct {
|
||
|
Packs []Pack
|
||
|
Picks []Card
|
||
|
}
|
||
|
|
||
|
// MakePod creates a pod with a specified number of players and a given set of packs
|
||
|
func MakePod(playerCount int, provider PackProvider) *Pod {
|
||
|
players := make([]*Player, playerCount)
|
||
|
for i := range players {
|
||
|
players[i] = &Player{
|
||
|
Packs: provider(),
|
||
|
Picks: []Card{},
|
||
|
}
|
||
|
}
|
||
|
return &Pod{
|
||
|
Players: players,
|
||
|
}
|
||
|
}
|