add turn to BoardState and remove it from RoyaleRuleset (#52)

This commit is contained in:
Rob O'Dwyer 2021-08-27 13:28:12 -07:00 committed by GitHub
parent 17556e15c1
commit e9f408cdbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 27 deletions

View file

@ -10,8 +10,6 @@ type RoyaleRuleset struct {
Seed int64
// TODO: move Turn into BoardState?
Turn int32
ShrinkEveryNTurns int32
}
@ -28,7 +26,7 @@ func (r *RoyaleRuleset) CreateNextBoardState(prevState *BoardState, moves []Snak
}
// Royale's only job is now to populate the hazards for next turn - StandardRuleset takes care of applying hazard damage.
err = r.populateHazards(nextBoardState, r.Turn)
err = r.populateHazards(nextBoardState, prevState.Turn+1)
if err != nil {
return nil, err
}