private ContentPublisher CalculatePublisher(IHaveSourcePaths game) { if (!Publishers.Any()) { throw new NotSupportedException("No supported Publishers found for: " + Id); } if (Publishers.HasPublisher(Publisher.withSIX)) { return(Publishers.GetPublisher(Publisher.withSIX)); } return(Publishers.HasPublisher(Publisher.Steam) && ((Game.SteamHelper.SteamFound && game.SteamDirectories.IsValid) || (Publishers.Count == 1)) ? Publishers.GetPublisher(Publisher.Steam) : Publishers.First(x => x.Publisher != Publisher.Steam)); }
public IAbsoluteDirectoryPath GetSourceDirectory(IHaveSourcePaths game) => game.ContentPaths.Path.GetChildDirectoryWithName(PackageName);
public ContentPublisher GetSource(IHaveSourcePaths game) => _source.Value;
private ContentPublisher CalculatePublisher(IHaveSourcePaths game) { if (!Publishers.Any()) throw new NotSupportedException("No supported Publishers found for: " + Id); if (Publishers.HasPublisher(Publisher.withSIX)) return Publishers.GetPublisher(Publisher.withSIX); return Publishers.HasPublisher(Publisher.Steam) && ((Game.SteamHelper.SteamFound && game.SteamDirectories.IsValid) || (Publishers.Count == 1)) ? Publishers.GetPublisher(Publisher.Steam) : Publishers.First(x => x.Publisher != Publisher.Steam); }
private IAbsoluteDirectoryPath GetSourceRoot(IHaveSourcePaths game) => GetSource(game).Publisher == Publisher.Steam ? game.SteamDirectories.Workshop.ContentPath : game.ContentPaths.Path;
public override ContentPublisher GetSource(IHaveSourcePaths game) => _publisher ?? (_publisher = CalculatePublisher(game));
public override IAbsoluteDirectoryPath GetSourceDirectory(IHaveSourcePaths game) => GetSourceRoot(game).GetChildDirectoryWithName(GetSource(game).PublisherId);