]> Dogcows Code - chaz/carfire/commitdiff
Gui Finding
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 30 Mar 2010 23:50:17 +0000 (23:50 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 30 Mar 2010 23:50:17 +0000 (23:50 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@41 92bb83a3-7c8f-8a45-bc97-515c4e399668

Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs

index 78ee37b7a9912c9dad0ebf700bf7b83be60d9dd7..c79b6a72d626a03520b2edc9d4ceb5b6ed72f271 100644 (file)
@@ -149,20 +149,20 @@ namespace CS_3505_Project_06
         {\r
             availableSessions = sessions;\r
 \r
-            if (availableSessions != null && availableSessions.Count > 0)\r
-            {\r
-                networkGame.JoinSession(availableSessions[0], JoinedSession);\r
-                currentState = lobbyState.JoiningGame;\r
-\r
-                availableSessions.Dispose();\r
-                availableSessions = null;\r
-            }\r
-            else\r
-            {\r
-                // TODO: This should do something more than just throw the player back to the welcome screen.\r
-                currentState = lobbyState.Welcome;\r
-                Console.WriteLine("No sessions to join!");\r
-            }\r
+            //if (availableSessions != null && availableSessions.Count > 0)\r
+            //{\r
+            //    networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+            //    currentState = lobbyState.JoiningGame;\r
+\r
+            //    availableSessions.Dispose();\r
+            //    availableSessions = null;\r
+            //}\r
+            //else\r
+            //{\r
+            //    // TODO: This should do something more than just throw the player back to the welcome screen.\r
+            //    currentState = lobbyState.Welcome;\r
+            //    Console.WriteLine("No sessions to join!");\r
+            //}\r
         }\r
 \r
         // TODO: New method.\r
@@ -229,11 +229,43 @@ namespace CS_3505_Project_06
                         currentState = lobbyState.Welcome;\r
                         ready = false;\r
                     }\r
+                    availableSessions = null;\r
                     networkGame.ErrorDelegate = AsyncCallbackFailed;\r
                     networkGame.FindSessions(FoundSessions);\r
                     currentState = lobbyState.FindingGames;\r
                     break;\r
 \r
+                case lobbyState.FindingGames:\r
+                    if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
+                    {\r
+                        currentState = lobbyState.Welcome;\r
+                        ready = false;\r
+                    }\r
+                    if (availableSessions != null && availableSessions.Count == 0)\r
+                        currentState = lobbyState.FindGame;\r
+                    else if (availableSessions != null && availableSessions.Count > 0)\r
+                    {\r
+                        if (currentKeyboardState.IsKeyDown(Keys.D1) && previousKeyboardState.IsKeyUp(Keys.D1))\r
+                        {\r
+                            networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+                            currentState = lobbyState.JoiningGame;\r
+\r
+                            availableSessions.Dispose();\r
+                            availableSessions = null;\r
+                        }\r
+                        if (currentKeyboardState.IsKeyDown(Keys.D2) && previousKeyboardState.IsKeyUp(Keys.D2))\r
+                        {\r
+                            networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+                            currentState = lobbyState.JoiningGame;\r
+\r
+                            availableSessions.Dispose();\r
+                            availableSessions = null;\r
+                        }\r
+                    }\r
+\r
+\r
+                    Console.WriteLine("Finding");\r
+                    break;\r
                 case lobbyState.Connected:\r
                     if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
                     {\r
@@ -244,6 +276,7 @@ namespace CS_3505_Project_06
                             networkGame.LeaveSession();\r
                         }\r
                         currentState = lobbyState.Welcome;\r
+                \r
                     }\r
                     if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))\r
                         networkGame.LocalGamer.IsReady = true;\r
This page took 0.022776 seconds and 4 git commands to generate.