init 2
This commit is contained in:
25
LightlessSync/UI/Models/PairDisplayEntry.cs
Normal file
25
LightlessSync/UI/Models/PairDisplayEntry.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
30
LightlessSync/UI/Models/PairUiEntry.cs
Normal file
30
LightlessSync/UI/Models/PairUiEntry.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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 PairUiEntry(
|
||||
PairDisplayEntry DisplayEntry,
|
||||
string AliasOrUid,
|
||||
string DisplayName,
|
||||
string Note,
|
||||
bool IsVisible,
|
||||
bool IsOnline,
|
||||
bool IsDirectlyPaired,
|
||||
bool IsOneSided,
|
||||
bool HasAnyConnection,
|
||||
bool IsPaused,
|
||||
UserPermissions SelfPermissions,
|
||||
UserPermissions OtherPermissions,
|
||||
IndividualPairStatus? PairStatus,
|
||||
long LastAppliedDataBytes,
|
||||
long LastAppliedDataTris,
|
||||
long LastAppliedApproximateVramBytes,
|
||||
long LastAppliedApproximateEffectiveVramBytes,
|
||||
IPairHandlerAdapter? Handler)
|
||||
{
|
||||
public PairUniqueIdentifier Ident => DisplayEntry.Ident;
|
||||
public IReadOnlyList<GroupFullInfoDto> Groups => DisplayEntry.Groups;
|
||||
}
|
||||
24
LightlessSync/UI/Models/PairUiSnapshot.cs
Normal file
24
LightlessSync/UI/Models/PairUiSnapshot.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using LightlessSync.API.Dto.Group;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
|
||||
namespace LightlessSync.UI.Models;
|
||||
|
||||
public sealed record PairUiSnapshot(
|
||||
IReadOnlyDictionary<string, Pair> PairsByUid,
|
||||
IReadOnlyList<Pair> DirectPairs,
|
||||
IReadOnlyDictionary<GroupFullInfoDto, IReadOnlyList<Pair>> GroupPairs,
|
||||
IReadOnlyDictionary<Pair, IReadOnlyList<GroupFullInfoDto>> PairsWithGroups,
|
||||
IReadOnlyDictionary<string, GroupFullInfoDto> GroupsByGid,
|
||||
IReadOnlyCollection<GroupFullInfoDto> Groups)
|
||||
{
|
||||
public static PairUiSnapshot Empty { get; } = new(
|
||||
new ReadOnlyDictionary<string, Pair>(new Dictionary<string, Pair>()),
|
||||
Array.Empty<Pair>(),
|
||||
new ReadOnlyDictionary<GroupFullInfoDto, IReadOnlyList<Pair>>(new Dictionary<GroupFullInfoDto, IReadOnlyList<Pair>>()),
|
||||
new ReadOnlyDictionary<Pair, IReadOnlyList<GroupFullInfoDto>>(new Dictionary<Pair, IReadOnlyList<GroupFullInfoDto>>()),
|
||||
new ReadOnlyDictionary<string, GroupFullInfoDto>(new Dictionary<string, GroupFullInfoDto>()),
|
||||
Array.Empty<GroupFullInfoDto>());
|
||||
}
|
||||
11
LightlessSync/UI/Models/VisiblePairSortMode.cs
Normal file
11
LightlessSync/UI/Models/VisiblePairSortMode.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LightlessSync.UI.Models;
|
||||
|
||||
public enum VisiblePairSortMode
|
||||
{
|
||||
Default = 0,
|
||||
Alphabetical = 1,
|
||||
VramUsage = 2,
|
||||
EffectiveVramUsage = 3,
|
||||
TriangleCount = 4,
|
||||
PreferredDirectPairs = 5,
|
||||
}
|
||||
Reference in New Issue
Block a user