{\r
public class lobbyGUI : ILobby\r
{\r
+ #region local variables\r
float scale;\r
\r
Texture2D background;\r
String chatMessage;\r
Queue<ChatInfo> currentChat;\r
\r
+ \r
+\r
private enum lobbyState\r
{\r
Welcome,\r
}\r
\r
lobbyState currentState;\r
+ #endregion\r
\r
public lobbyGUI()\r
{\r
\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
}\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
\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
}\r
\r
}\r
- else\r
+ else //normal op mode\r
{\r
UpdateChat(gameTime, networkGame);\r
chatMessage = "";\r
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
}\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
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