X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=Project06%2FCS%203505%20Project%2006%2FCS%203505%20Project%2006%2FNetworkGame.cs;h=3d46d569ed80bf4a11fbd6fc165c4793ce45ca12;hb=dadc9d60b083667f0109b32a55fed00100a1cd36;hp=62c4b948f762634c517fe7e95fb66b2510d7e3d4;hpb=b2b6aae65f44491a7fac195a287e943bfe4cc4a4;p=chaz%2Fcarfire diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs index 62c4b94..3d46d56 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs @@ -69,7 +69,7 @@ namespace CS_3505_Project_06 // I added this as I needed a way to display all gamers not just the first gamer // -Brady - public GamerCollection LocalGamers + public GamerCollection NetworkGamers { get { @@ -115,6 +115,15 @@ namespace CS_3505_Project_06 return mNetworkSession; } + // added to begin the game. I made the LobbyGUI make sure that only the host will call it when everyone is ready. + // This is already taken care of in the update method below. But it may be nice to allow the host to signal the start + // rather then having it start automatically. Just a suggestion. + // -Brady + public void StartGame() + { + mNetworkSession.StartGame(); + mNetworkSession.ResetReady(); + } public void LeaveSession() { @@ -170,8 +179,16 @@ namespace CS_3505_Project_06 public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { - mLobby.Draw(spriteBatch); - DrawTestHarness(gameTime, spriteBatch); + if (mNetworkSession != null) + { + if (mNetworkSession.SessionState == NetworkSessionState.Playing) + DrawTestHarness(gameTime, spriteBatch); + else + mLobby.Draw(spriteBatch); + } + else + mLobby.Draw(spriteBatch); + }