Fix: cookie; add llm parser interface
This commit is contained in:
@ -103,6 +103,15 @@ func (r *Room) CanStart() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func getGuesser(m map[string]BotPlayer, team UserTeam) string {
|
||||
for k, v := range m {
|
||||
if v.Team == team && v.Role == UserRoleGuesser {
|
||||
return k
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// WhichBotToMove returns bot name that have to move or empty string
|
||||
func (r *Room) WhichBotToMove() string {
|
||||
fmt.Println("looking for bot to move", "team-turn", r.TeamTurn, "mime-done", r.MimeDone, "bot-map", r.BotMap, "is_running", r.IsRunning)
|
||||
@ -116,16 +125,18 @@ func (r *Room) WhichBotToMove() string {
|
||||
if ok {
|
||||
return r.BlueTeam.Mime
|
||||
}
|
||||
} else {
|
||||
return getGuesser(r.BotMap, UserTeamBlue)
|
||||
}
|
||||
// check gussers
|
||||
case UserTeamRed:
|
||||
if !r.MimeDone {
|
||||
_, ok := r.BotMap[r.RedTeam.Mime]
|
||||
if ok {
|
||||
return r.RedTeam.Mime
|
||||
}
|
||||
} else {
|
||||
return getGuesser(r.BotMap, UserTeamRed)
|
||||
}
|
||||
// check gussers
|
||||
default:
|
||||
// how did we got here?
|
||||
return ""
|
||||
|
Reference in New Issue
Block a user