]> Dogcows Code - chaz/carfire/commitdiff
Added more comments to gui code, lots of refactoring still needed. Probably will...
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 31 Mar 2010 07:46:58 +0000 (07:46 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 31 Mar 2010 07:46:58 +0000 (07:46 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@48 92bb83a3-7c8f-8a45-bc97-515c4e399668

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

index 6eaaf1892f4fbcdb45401f5001a398be0bec3159..08efb7c34df81445e0ac23e47d91f28ada4fdbc9 100644 (file)
@@ -14,6 +14,7 @@ namespace CS_3505_Project_06
 {\r
     public class lobbyGUI : ILobby\r
     {\r
+        #region local variables\r
         float scale;\r
 \r
         Texture2D background;\r
@@ -65,6 +66,8 @@ namespace CS_3505_Project_06
         String chatMessage;\r
         Queue<ChatInfo> currentChat;\r
 \r
+        \r
+\r
         private enum lobbyState\r
         {\r
             Welcome,\r
@@ -76,6 +79,7 @@ namespace CS_3505_Project_06
         }\r
 \r
         lobbyState currentState;\r
+        #endregion\r
 \r
         public lobbyGUI()\r
         {\r
@@ -136,7 +140,9 @@ namespace CS_3505_Project_06
             \r
         }\r
 \r
-        // TODO: New method.\r
+        /// <summary>\r
+        /// Transition into connected state\r
+        /// </summary>\r
         void JoinedSession(NetworkSession session, NetworkGame networkGame)\r
         {\r
             if (session != null)\r
@@ -151,19 +157,26 @@ namespace CS_3505_Project_06
             }\r
         }\r
 \r
-        // TODO: New method.\r
+        /// <summary>\r
+        /// Called when Async FindSession returns. Available sessions is then updated\r
+        /// </summary>\r
         void FoundSessions(AvailableNetworkSessionCollection sessions, NetworkGame networkGame)\r
         {\r
             availableSessions = sessions;\r
         }\r
 \r
-        // TODO: New method.\r
+        /// <summary>\r
+        /// Catches exceptions for and Async calls\r
+        /// </summary>\r
         void AsyncCallbackFailed(Exception exception, NetworkGame networkGame)\r
         {\r
             currentState = lobbyState.Welcome;\r
             Console.WriteLine("Exception as thrown during async call: " + exception.Message);\r
         }\r
 \r
+        /// <summary>\r
+        /// Adds and new chats to the chat list. If chat list is full, older messages are removed.\r
+        /// </summary>\r
         private void UpdateChat(GameTime gameTime, NetworkGame networkGame)\r
         {\r
             List<ChatInfo> chts = networkGame.ReceiveChats();\r
@@ -181,6 +194,9 @@ namespace CS_3505_Project_06
 \r
         }\r
 \r
+        /// <summary>\r
+        /// Main update call for Lobby, what is actually updated is determined by what the current state is.\r
+        /// </summary>\r
         public long Update(GameTime gameTime, NetworkGame networkGame)\r
         {\r
             \r
@@ -310,7 +326,7 @@ namespace CS_3505_Project_06
                         }\r
                         \r
                     }\r
-                    else\r
+                    else  //normal op mode\r
                     {\r
                         UpdateChat(gameTime, networkGame);\r
                         chatMessage = "";\r
@@ -437,6 +453,9 @@ namespace CS_3505_Project_06
             return 1;\r
         }\r
 \r
+        /// <summary>\r
+        /// Updates backgound animation with moving spotlight. Spotlight bounces off walls \r
+        /// </summary>\r
         private void UpdateSpotLight(GameTime gameTime)\r
         {\r
             spotLightPos = new Vector2(spotLightPos.X + spotLightVelocity.X * (float)gameTime.ElapsedGameTime.TotalSeconds,\r
@@ -452,6 +471,9 @@ namespace CS_3505_Project_06
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Draws the list of current chat messages received by the local client.\r
+        /// </summary>\r
         private void DrawChatInfo(SpriteBatch spriteBatch)\r
         {\r
             if (currentChat.Count > 0)\r
@@ -467,6 +489,9 @@ namespace CS_3505_Project_06
                 spriteBatch.DrawString(menuFont, chatMessage, new Vector2(400, 10 + 15*(currentChat.Count + 1)), Color.Green, 0f, zero, .6f, SpriteEffects.None, 1f);\r
         }\r
 \r
+        /// <summary>\r
+        /// Draws player list objects for the connected state.\r
+        /// </summary>\r
         private void DrawPlayerList(SpriteBatch spriteBatch)\r
         {\r
             \r
This page took 0.027518 seconds and 4 git commands to generate.