using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EQNetwork;
using EQNetwork.Objects;
using EQNetwork.Interfaces;

namespace EQNetwork.Services
{
    public partial class SessionService : ISessionService
    {
        public Session Session { get; set; }

        private EQProcess _eq;
        public SessionService(EQProcess eq)
        {
            _eq = eq;
        }

        private IEQApiService _api { get { return _eq.EQApiService; } }

        public void Create(Guid sessionGuid)
        {
            Session session = new Session();
            session.SessionGuid = sessionGuid;
            this.Session = session;
        }

        public Session Create(string username, string password)
        {
            Session session = _api.Session_Create(username, password);
            this.Session = session;
            return session;
        }

        public Session Check(Guid sessionGuid)
        {
            Session session = _api.Session_Check(sessionGuid);
            this.Session = session;
            return session;
        }
    }
}
