/// <summary> /// Select <see cref="Session"/>s with the given game key. Use this as an extension method on <see cref="SessionState"/> /// </summary> /// <param name="sessionState"></param> /// <param name="gameKey">Key of the game (eg: csgo)</param> /// <returns>An <see cref="ImmutableArray"/> of <see cref="Session"/></returns> public static ImmutableArray <Session> SelectSessionListForGame(this SessionState sessionState, string gameKey) { return(sessionState.Sessions.Values.Where(session => session.Image == gameKey).ToImmutableArray()); }
/// <summary> /// Select all the active <see cref="Session"/>s. Use this as an extension method on <see cref="SessionState"/> /// </summary> /// <param name="sessionState"></param> /// <returns>An <see cref="ImmutableArray"/> of <see cref="Session"/></returns> public static ImmutableArray <Session> SelectSessionList(this SessionState sessionState) { return(sessionState.Sessions.Values.ToImmutableArray()); }
internal SessionStore() { sessionState = SessionState.WithSessions(new Dictionary <string, Session>()); }