]> Dogcows Code - chaz/carfire/commitdiff
testing, reset moved into a new gameStarted event
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Mon, 29 Mar 2010 06:13:16 +0000 (06:13 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Mon, 29 Mar 2010 06:13:16 +0000 (06:13 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@33 92bb83a3-7c8f-8a45-bc97-515c4e399668

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

index 2386ef60717983e77271ee1aa4a81a16683769c9..55ab93d6b9be901526064126696dd82eb240b677 100644 (file)
@@ -104,10 +104,17 @@ namespace CS_3505_Project_06
             mNetworkSession = NetworkSession.EndCreate(result);\r
             mNetworkSession.AllowHostMigration = true;\r
             mNetworkSession.AllowJoinInProgress = false;\r
-\r
+            mNetworkSession.GameStarted += new EventHandler<GameStartedEventArgs>(mNetworkSession_GameStarted);\r
             mJoinedSessionDelegate(mNetworkSession, this);\r
         }\r
 \r
+\r
+        //gamestarted event\r
+        void mNetworkSession_GameStarted(object sender, GameStartedEventArgs e)\r
+        {\r
+            Reset();\r
+        }\r
+\r
         /// <summary>\r
         /// Determine whether or not the network game object is associated with any network session.\r
         /// </summary>\r
@@ -232,10 +239,6 @@ namespace CS_3505_Project_06
                 if (mNetworkSession.SessionState == NetworkSessionState.Lobby)\r
                 {\r
                     mLobby.Update(gameTime, this);\r
-\r
-                    //if state started as lobby and was changed to playing, call reset.\r
-                    if (mNetworkSession.SessionState == NetworkSessionState.Playing)\r
-                        Reset();\r
                 }\r
                 else if (mNetworkSession.SessionState == NetworkSessionState.Playing)\r
                 {\r
This page took 0.02366 seconds and 4 git commands to generate.