wip: turn generation
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user