fix: sync逻辑添加 setLevel

main v1.3.3
NoahLan 11 months ago
parent 4aa8b76f09
commit 143ec53b66

@ -327,12 +327,13 @@ func (e *GtpEngine) SetFreeHandicap(vexArr ...string) bool {
// Sync 同步
// handicaps: points of all handicaps
// plays: [][2]string -> [["B","A1"]]
func (e *GtpEngine) Sync(size int, komi float64, handicaps []string, plays [][]string) bool {
func (e *GtpEngine) Sync(size int, komi float64, level int, handicaps []string, plays [][]string) bool {
// 1. komi
// 2. boardsize
// 3. clear_board
// 4. set_free_handicap pos1 pos2 ...
// 5~n. play X XX
// 3. set_level
// 4. clear_board
// 5. set_free_handicap pos1 pos2 ...
// 6~n. play X XX
playAllFn := func() bool {
return narr.Every(plays, func(_ int, v []string) bool {
@ -346,6 +347,7 @@ func (e *GtpEngine) Sync(size int, komi float64, handicaps []string, plays [][]s
return e.Komi(komi) &&
e.BoardSize(size) &&
e.SetLevel(level) &&
e.ClearBoard() &&
e.SetFreeHandicap(handicaps...) &&
playAllFn()

Loading…
Cancel
Save