Esempio n. 1
0
 public PlayContentAction GetAction(Game game)
 => new PlayContentAction(
     Contents
     .DistinctBy(x => x.Id)
     .Select(x => new ContentSpec(game.Contents.FindContentOrThrow(x.Id), x.Constraint))
     .ToArray(), cancelToken: CancelToken)
 {
     Name = Name, Href = GetHref(game)
 };
Esempio n. 2
0
 public ILaunchContentAction <Content> GetAction(Game game) => new LaunchContentAction(
     Contents
     .DistinctBy(x => x.Id)
     .Select(x => new ContentSpec(game.Contents.FindContentOrThrow(x.Id), x.Constraint))
     .ToArray(), cancelToken: CancelToken)
 {
     Action        = Action,
     Name          = Name,
     Href          = GetHref(game),
     ServerAddress = ServerAddress
 };
Esempio n. 3
0
 public DownloadContentAction GetAction(Game game) => new DownloadContentAction(CancelToken,
                                                                                Contents
                                                                                // Specifying multiple times the same content is invalid - we should block this already on input?
                                                                                .DistinctBy(x => x.Id)
                                                                                .Select(x => new { Content = game.Contents.FindContentOrThrow(x.Id) as IInstallableContent, x.Constraint })
                                                                                .Where(x => x.Content != null)
                                                                                .Select(x => new InstallContentSpec(x.Content, x.Constraint))
                                                                                .ToArray())
 {
     Name             = Name,
     HideLaunchAction = HideLaunchAction,
     Force            = Force,
     Href             = GetHref(game)
 };