public void SetMatch(Match match) { MapName = match.Map; _match = match; var operandA = match.Player1; var operandB = match.Player2; _betOperandA = operandA; _betOperandB = operandB; UpdateSummary(); }
public void FinishMatch(IBetOperand winner) { MyMatch.IsEditable = false; var url = _userData.PgSession.GetWebApiV1Function("/matches/" + MyMatch.Id + ".json"); var poco = new { winner_id = winner.Id, winner_type = winner.PocoType, }; var root = new { match = poco }; RestResponse<ApiResponse> response = null; _userData.PgSession.BeginAndCallback(delegate { response = SocketSession.Rest<ApiResponse>(url, Method.PUT, root); }, delegate { if (!response.IsOk()) { MyMatch.IsEditable = true; MessageDialog.Show(_window, "Failed to finish match", "Sorry, failed to finish match.\r\nDetails: " + response.ErrorMessage); } }); }