using System.Collections.Concurrent;
using H.Pipes;
using InABox.Core;

namespace InABox.IPC
{
    public class IPCPushState
    {
        public class Session
        {
            public PipeConnection<IPCMessage?> Connection { get; }

            public Guid SessionID { get; }

            public Platform Platform { get; }

            public Session(PipeConnection<IPCMessage?> connection, Guid sessionID, Platform platform)
            {
                Connection = connection;
                SessionID = sessionID;
                Platform = platform;
            }
        }

        public ConcurrentDictionary<Guid, Session> SessionMap = new();

        public event IPCPollEvent? OnPoll;

        public void Poll(Session session)
        {
            OnPoll?.Invoke(session);
        }
    }
}