MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / getChessString

Function getChessString

plugin/chess/core.go:610–618  ·  view source on GitHub ↗

getChessString 获取 PGN 字符串

(room chessRoom)

Source from the content-addressed store, hash-verified

608
609// getChessString 获取 PGN 字符串
610func getChessString(room chessRoom) string {
611 game := room.chessGame
612 dataString := fmt.Sprintf("[Date \"%s\"]\n", time.Now().Format("2006-01-02"))
613 whiteString := fmt.Sprintf("[White \"%s\"]\n", room.whiteName)
614 blackString := fmt.Sprintf("[Black \"%s\"]\n", room.blackName)
615 chessString := game.String()
616
617 return dataString + whiteString + blackString + chessString
618}
619
620// getELORate 获取玩家的 ELO 等级分
621func getELORate(whiteUin, blackUin int64, dbService *chessDBService) (whiteRate int, blackRate int, err error) {

Callers 4

drawFunction · 0.85
resignFunction · 0.85
playFunction · 0.85
abortGameFunction · 0.85

Calls 2

FormatMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected