private async Task <HttpResponseMessage> CreateManual() { JArray drawing = DrawViewModel.GetDrawing(); List <string> clues = new List <string>(); foreach (var hint in Hints) { clues.Add(hint.Hint.Trim()); } var newGame = new JObject(new JProperty("solution", Solution.Trim()), new JProperty("clues", clues.ToArray()), new JProperty("difficulty", SelectedDifficulty.ToLower()), new JProperty("drawing", drawing), new JProperty("displayMode", SelectedDisplayMode.ToLower()), new JProperty("side", SelectedPanoramicMode.ToLower())); var content = new StringContent(newGame.ToString(), Encoding.UTF8, "application/json"); return(await ServerService.instance.client.PostAsync(Constants.SERVER_PATH + Constants.GAMECREATOR_PATH, content)); }
private async Task <HttpResponseMessage> CreateAssisted2() { List <string> clues = new List <string>(); foreach (var hint in Hints) { if (hint.Hint.Length > 0) { clues.Add(hint.Hint.Trim()); } } var newGame = new JObject(new JProperty("solution", ObjectName.Trim()), new JProperty("clues", clues.ToArray()), new JProperty("difficulty", SelectedDifficulty.ToLower()), new JProperty("drawing", GeneratedImageStrokes), new JProperty("displayMode", SelectedDisplayMode), new JProperty("side", SelectedPanoramicMode.ToLower())); var content = new StringContent(newGame.ToString(), Encoding.UTF8, "application/json"); return(await ServerService.instance.client.PostAsync(Constants.SERVER_PATH + Constants.GAMECREATOR_PATH, content)); }