소스 검색

changed code

Yorick Rommers 10 년 전
부모
커밋
882a63466d
1개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 7
      YJMPD-UWP/Model/ApiHandler.cs

+ 6 - 7
YJMPD-UWP/Model/ApiHandler.cs

@@ -78,14 +78,13 @@ namespace YJMPD_UWP.Model
 
 
                     Util.ShowToastNotification(winner + " won!", "Press Ready or Leave");
                     Util.ShowToastNotification(winner + " won!", "Press Ready or Leave");
 
 
-                    JArray players = (JArray)o["players"];
-
-                    foreach(JToken pl in players)
+                    foreach(var i in (JObject) o["players"])
                     {
                     {
-                        string username = pl["username"].ToString();
-                        double points = (double)pl["points"];
-                        double pointstotal = (double)pl["pointstotal"];
-
+                        Debug.WriteLine(i.Key);
+                        Debug.WriteLine(i.Value["points"]);
+                        string username = i.Key;
+                        double points = i.Value["points"].ToObject<Double>();
+                        double pointstotal = i.Value["pointstotal"].ToObject<Double>();
                         App.Game.UpdatePlayer(username, pointstotal, points);
                         App.Game.UpdatePlayer(username, pointstotal, points);
                     }
                     }