draftbot/bot/bot.go

38 lines
868 B
Go

package bot
import (
"math/rand"
"git.fromouter.space/mcg/draft"
)
// Bot implements a bot for filling spots in draft pods
type Bot struct {
player *draft.Player
// Currently unused, the bot just picks at random.
// In the future, these fields will be used for having the bot try to assemble
// a sort-of playable deck. The actual deck doesn't matter, just the fact
// that their picks make some sort of sense.
color1 string
color2 string
entryCount int
friendCount int
otherCount int
}
// MakeBot returns a bot for a given pod spot
func MakeBot(player *draft.Player) *Bot {
bot := &Bot{
player: player,
}
return bot
}
// PickNext makes the bot pick a card from his pack
func (b *Bot) PickNext() {
// For now, just pick a card at random
cardid := rand.Intn(len(b.player.CurrentPack))
b.player.Pick(b.player.CurrentPack[cardid])
}