using System; using System.Collections.Generic; using Woodpecker.Core; namespace Woodpecker.Game.Arcade { public class arcadeManager { #region Fields private List mLobbies = new List(); #endregion #region Methods /// /// Tries to return arcadeGameLobby instance of a given room ID from the game lobby collection. If the game lobby is not found, null is returned. /// /// The database ID of the room to get the lobby of. public arcadeGameLobby getLobby(int roomID) { foreach (arcadeGameLobby lLobby in mLobbies) { if (lLobby.roomID == roomID) return lLobby; } return null; } /// /// Iterates through all hooked game lobbies to find a game with a given ID. If the game is not found, null is returned. /// /// The unique ID of the game to retrieve. public arcadeGame getGame(int ID) { foreach (arcadeGameLobby lLobby in mLobbies) { arcadeGame pGame = lLobby.getGame(ID); if (pGame != null) return pGame; } return null; } #endregion } }