wip: turn generation

This commit is contained in:
Ilia Denisov
2026-01-08 22:17:37 +02:00
parent 972cfd82be
commit b3de13b6e1
6 changed files with 223 additions and 2 deletions
+6
View File
@@ -94,6 +94,12 @@ func (g *Game) GiveVotes(race, recipient string) error {
}
func (g Game) relationInternal(ri, other int) (RaceRelation, error) {
if ri == other {
return RaceRelation{
RaceID: g.Race[ri].ID,
Relation: RelationPeace,
}, nil
}
rel := slices.IndexFunc(g.Race[ri].Relations, func(r RaceRelation) bool { return r.RaceID == g.Race[other].ID })
if rel < 0 {
return RaceRelation{}, e.NewGameStateError("Relation: opponent not found")