using LightlessSync.API.Dto.User; using LightlessSync.PlayerData.Pairs; using LightlessSync.Services.Mediator; using LightlessSync.Services.ServerConfiguration; using Microsoft.Extensions.Logging; namespace LightlessSync.PlayerData.Factories; public class PairFactory { private readonly PairHandlerFactory _cachedPlayerFactory; private readonly ILoggerFactory _loggerFactory; private readonly MareMediator _mareMediator; private readonly ServerConfigurationManager _serverConfigurationManager; public PairFactory(ILoggerFactory loggerFactory, PairHandlerFactory cachedPlayerFactory, MareMediator mareMediator, ServerConfigurationManager serverConfigurationManager) { _loggerFactory = loggerFactory; _cachedPlayerFactory = cachedPlayerFactory; _mareMediator = mareMediator; _serverConfigurationManager = serverConfigurationManager; } public Pair Create(UserFullPairDto userPairDto) { return new Pair(_loggerFactory.CreateLogger(), userPairDto, _cachedPlayerFactory, _mareMediator, _serverConfigurationManager); } public Pair Create(UserPairDto userPairDto) { return new Pair(_loggerFactory.CreateLogger(), new(userPairDto.User, userPairDto.IndividualPairStatus, [], userPairDto.OwnPermissions, userPairDto.OtherPermissions), _cachedPlayerFactory, _mareMediator, _serverConfigurationManager); } }