Parcourir la source

shit works mostly, able to proceed to picture taking now

Yorick Rommers il y a 10 ans
Parent
commit
2c9bb142a6

+ 9 - 2
YJMPD-UWP/Model/ApiHandler.cs

@@ -32,10 +32,10 @@ namespace YJMPD_UWP.Model
 
         public void HandleMessage(JObject o)
         {
-            Debug.WriteLine("Reached HandleMessage in API");
+            Debug.WriteLine(o.ToString());
             Command c = (Command)Enum.Parse(typeof(Command), o["command"].ToString());
 
-            switch(c)
+            switch (c)
             {
                 case Command.GameFound:
                     GameFound();
@@ -44,6 +44,13 @@ namespace YJMPD_UWP.Model
                     Debug.WriteLine("Played joined");
                     PlayerJoined(o[Command.PlayerJoined.ToString()].ToString());
                     break;
+                case Command.Picture:
+                    if (o["selected"].ToObject<bool>() == true)
+                    {
+                        Debug.WriteLine("Selected player taking picture");
+                        App.Game.Selected = true;
+                    }
+                    break;
                 default:
                     //Do nothing
                     break;

+ 1 - 1
YJMPD-UWP/Model/GameHandler.cs

@@ -24,7 +24,7 @@ namespace YJMPD_UWP.Model
 
         public List<Player> Players { get; private set; }
 
-        public bool Selected { get; private set; }
+        public bool Selected { get; set; }
 
         private void UpdateGameStatus(GameStatus status)
         {

+ 0 - 1
YJMPD-UWP/Model/NetworkHandler.cs

@@ -112,7 +112,6 @@ namespace YJMPD_UWP.Model
 
         public void HandleMessage(string data)
         {
-            Debug.WriteLine(data);
             JObject o = JObject.Parse(data);
             App.Api.HandleMessage(o);