]> Dogcows Code - chaz/carfire/blobdiff - Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs
testing
[chaz/carfire] / Project06 / CS 3505 Project 06 / CS 3505 Project 06 / NetworkGame.cs
index b27393201e3b793331abb547d6208c5654bed132..3d46d569ed80bf4a11fbd6fc165c4793ce45ca12 100644 (file)
@@ -69,11 +69,11 @@ namespace CS_3505_Project_06
 \r
         // I added this as I needed a way to display all gamers not just the first gamer\r
         //    -Brady\r
-        public GamerCollection<LocalNetworkGamer> LocalGamers\r
+        public GamerCollection<NetworkGamer> NetworkGamers\r
         {\r
             get\r
             {\r
-                return mNetworkSession.LocalGamers;\r
+                return mNetworkSession.AllGamers;\r
             }\r
         }\r
 \r
@@ -115,6 +115,15 @@ namespace CS_3505_Project_06
             return mNetworkSession;\r
         }\r
 \r
+        // added to begin the game. I made the LobbyGUI make sure that only the host will call it when everyone is ready.\r
+        // This is already taken care of in the update method below. But it may be nice to allow the host to signal the start\r
+        // rather then having it start automatically. Just a suggestion. \r
+        //    -Brady\r
+        public void StartGame()\r
+        {\r
+            mNetworkSession.StartGame();\r
+            mNetworkSession.ResetReady();\r
+        }\r
 \r
         public void LeaveSession()\r
         {\r
@@ -170,8 +179,16 @@ namespace CS_3505_Project_06
 \r
         public void Draw(GameTime gameTime, SpriteBatch spriteBatch)\r
         {\r
-            mLobby.Draw(spriteBatch);\r
-            DrawTestHarness(gameTime, spriteBatch);\r
+            if (mNetworkSession != null)\r
+            {\r
+                if (mNetworkSession.SessionState == NetworkSessionState.Playing)\r
+                    DrawTestHarness(gameTime, spriteBatch);\r
+                else\r
+                    mLobby.Draw(spriteBatch);\r
+            }\r
+            else\r
+                mLobby.Draw(spriteBatch);\r
+            \r
         }\r
 \r
 \r
This page took 0.021257 seconds and 4 git commands to generate.