using System.Collections.Generic;
using LightlessSync.API.Data;
using LightlessSync.API.Data.Enum;
using LightlessSync.API.Dto.Group;
using LightlessSync.PlayerData.Pairs;

namespace LightlessSync.UI.Models;

public sealed record PairDisplayEntry(
    PairUniqueIdentifier Ident,
    PairConnection Connection,
    IReadOnlyList<GroupFullInfoDto> Groups,
    IPairHandlerAdapter? Handler)
{
    public UserData User => Connection.User;
    public bool IsOnline => Connection.IsOnline;
    public bool IsVisible => Handler?.IsVisible ?? false;
    public bool IsDirectlyPaired => Connection.IsDirectlyPaired;
    public bool IsOneSided => Connection.IsOneSided;
    public bool HasAnyConnection => Connection.HasAnyConnection;
    public string? IdentString => Connection.Ident;
    public UserPermissions SelfPermissions => Connection.SelfToOtherPermissions;
    public UserPermissions OtherPermissions => Connection.OtherToSelfPermissions;
    public IndividualPairStatus? PairStatus => Connection.IndividualPairStatus;
}
