Feat: clear marks after end of the turn
This commit is contained in:
		| @@ -83,6 +83,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		fi.Room.MimeDone = false | ||||
| 		fi.Room.OpenedThisTurn = 0 | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 		fi.Room.ClearMarks() | ||||
| 	} | ||||
| 	switch string(color) { | ||||
| 	case "black": | ||||
| @@ -100,6 +101,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		fi.Room.OpenedThisTurn = 0 | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 		fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 		fi.Room.ClearMarks() | ||||
| 	case "white", string(oppositeColor): | ||||
| 		log.Debug("opened opposite color word", "room", fi.Room, "opposite-color", oppositeColor) | ||||
| 		// end turn | ||||
| @@ -120,6 +122,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 				Action:     models.ActionTypeGameOver, | ||||
| 			} | ||||
| 			fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 			fi.Room.ClearMarks() | ||||
| 		} | ||||
| 		if fi.Room.RedCounter == 0 { | ||||
| 			// red won | ||||
| @@ -133,6 +136,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 				Action:     models.ActionTypeGameOver, | ||||
| 			} | ||||
| 			fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 			fi.Room.ClearMarks() | ||||
| 		} | ||||
| 	} | ||||
| 	if err := saveFullInfo(fi); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder