Beispiel #1
0
func ResetGame(logName string, creator bool, u *uistate.UIState) {
	u.M.Lock()
	defer u.M.Unlock()
	go sendTrueIfExists(u.GameChan)
	u.PlayerData = make(map[int]int)
	u.CurPlayerIndex = -1
	u.LogSG = logName
	writeLogAddr(logName, creator)
	u.CurTable.NewGame()
	tmp := strings.Split(logName, "-")
	gameID, _ := strconv.Atoi(tmp[len(tmp)-1])
	u.GameID = gameID
	u.GameChan = make(chan bool)
	go UpdateGame(u.GameChan, u)
}