Exemplo n.º 1
0
        /// <summary>
        /// Выдергивает спойлеры со страницы
        /// </summary>
        /// <param name="mainNode">Кусок html, в которм будет производится поиск</param>
        /// <param name="readyPost">Пост, к которому будет относится спойлер</param>
        /// <returns></returns>
        private List <Spoiler> ParsingSpoilers(HtmlNode mainNode, ReadyPost readyPost)
        {
            // выбираем все спойлеры. В нодах оказывается храниться весь документ
            // вне зависимости от того, что и когда мы парсили
            // поэтому здесь поиск xpath опять идет от корня
            HtmlNodeCollection spoilersNode = mainNode.SelectNodes(@"//table[@id=""details""]/tr[1]/td[2]//div[@class=""hidewrap""]");

            if (spoilersNode != null)
            {
                List <Spoiler> spoilers = new List <Spoiler>();

                foreach (var item in spoilersNode)
                {
                    Spoiler itemHtml = new Spoiler()
                    {
                        Header    = item.FirstChild.InnerText,
                        Body      = item.LastChild.InnerHtml,
                        ReadyPost = readyPost,
                    };

                    spoilers.Add(itemHtml);
                    // Чтобы корректно спарсить описание, необходимо удалить все спойлеры
                    // По этой же причине не используется linq
                    item.RemoveAll();
                }
                return(spoilers);
            }
            else
            {
                MessageService.ShowError("Ошибка при парсинге спойлеров раздачи");
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the spoiler.
        /// </summary>
        /// <param name="spoiler">The spoiler.</param>
        /// <returns>
        /// Returns Spoiler that was Created
        /// </returns>
        public async Task <Spoiler> CreateSpoiler(Spoiler spoiler)
        {
            _context.Spoilers.Add(spoiler);
            await _context.SaveChangesAsync();

            return(await RetrieveSpoiler(spoiler.ID));
        }
Exemplo n.º 3
0
        public async void CanUpdateSpoiler()
        {
            DbContextOptions <SpoiltContext> options =
                new DbContextOptionsBuilder <SpoiltContext>()
                .UseInMemoryDatabase("CanUpdateSpoiler")
                .Options;

            using (SpoiltContext context = new SpoiltContext(options))
            {
                Spoiler spoiler = new Spoiler();
                spoiler.SpoilerText = "Spoilers!";

                context.Spoilers.Add(spoiler);
                await context.SaveChangesAsync();

                spoiler.SpoilerText = "NoSpoilers!";

                context.Spoilers.Update(spoiler);
                await context.SaveChangesAsync();

                var spoilerText = await context.Spoilers.FirstOrDefaultAsync(x => x.SpoilerText == spoiler.SpoilerText);

                Assert.Equal("NoSpoilers!", spoilerText.SpoilerText);
            }
        }
Exemplo n.º 4
0
        public async Task <IActionResult> PutSpoiler([FromRoute] int id, [FromBody] Spoiler spoiler)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != spoiler.ID)
            {
                return(BadRequest());
            }

            await _spoilerContext.UpdateSpoiler(id, spoiler);

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SpoilerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 5
0
        public static void CreateSpoilerLog(RandomizedResult randomized, GameplaySettings settings, OutputSettings outputSettings)
        {
            var itemList = randomized.ItemList
                           .Where(io => !io.Item.IsFake())
                           .Select(u => new SpoilerItem(u, ItemUtils.IsRequired(u.Item, randomized), ItemUtils.IsImportant(u.Item, randomized)));
            var settingsString = settings.ToString();

            var directory = Path.GetDirectoryName(outputSettings.OutputROMFilename);
            var filename  = $"{Path.GetFileNameWithoutExtension(outputSettings.OutputROMFilename)}";

            var     plainTextRegex = new Regex("[^a-zA-Z0-9' .\\-]+");
            Spoiler spoiler        = new Spoiler()
            {
                Version                      = Randomizer.AssemblyVersion,
                SettingsString               = settingsString,
                Seed                         = randomized.Seed,
                RandomizeDungeonEntrances    = settings.RandomizeDungeonEntrances,
                ItemList                     = itemList.Where(u => !u.Item.IsFake()).ToList(),
                NewDestinationIndices        = randomized.NewDestinationIndices,
                Logic                        = randomized.Logic,
                CustomItemListString         = settings.UseCustomItemList ? settings.CustomItemListString : null,
                CustomStartingItemListString = settings.CustomStartingItemList.Any() ? settings.CustomStartingItemListString : null,
                CustomJunkLocationsString    = settings.CustomJunkLocationsString,
                GossipHints                  = randomized.GossipQuotes?.ToDictionary(me => (GossipQuote)me.Id, (me) =>
                {
                    var message     = me.Message.Substring(1);
                    var soundEffect = message.Substring(0, 2);
                    message         = message.Substring(2);
                    if (soundEffect == "\x69\x0C")
                    {
                        // real
                    }
                    else if (soundEffect == "\x69\x0A")
                    {
                        // fake
                        message = "FAKE - " + message;
                    }
                    else
                    {
                        // junk
                        message = "JUNK - " + message;
                    }
                    return(plainTextRegex.Replace(message.Replace("\x11", " "), ""));
                }),
            };

            if (outputSettings.GenerateHTMLLog)
            {
                using (StreamWriter newlog = new StreamWriter(Path.Combine(directory, filename + "_Tracker.html")))
                {
                    Templates.HtmlSpoiler htmlspoiler = new Templates.HtmlSpoiler(spoiler);
                    newlog.Write(htmlspoiler.TransformText());
                }
            }

            if (outputSettings.GenerateSpoilerLog)
            {
                CreateTextSpoilerLog(spoiler, Path.Combine(directory, filename + "_SpoilerLog.txt"));
            }
        }
Exemplo n.º 6
0
        private static void CreateTextSpoilerLog(Spoiler spoiler, string path)
        {
            StringBuilder log = new StringBuilder();

            log.AppendLine($"{"Version:",-17} {spoiler.Version}");
            log.AppendLine($"{"Settings:",-17} {spoiler.SettingsString}");
            log.AppendLine($"{"Seed:",-17} {spoiler.Seed}");
            log.AppendLine();

            if (spoiler.DungeonEntrances.Any())
            {
                log.AppendLine($" {"Entrance",-21}    {"Destination"}");
                log.AppendLine();
                foreach (var kvp in spoiler.DungeonEntrances)
                {
                    log.AppendLine($"{kvp.Key.Entrance(),-21} -> {kvp.Value.Entrance()}");
                }
                log.AppendLine("");
            }

            log.AppendLine($" {"Location",-50}    {"Item"}");
            foreach (var region in spoiler.ItemList.GroupBy(item => item.Region).OrderBy(g => g.Key))
            {
                log.AppendLine();
                log.AppendLine($" {region.Key.Name()}");
                foreach (var item in region.OrderBy(item => item.NewLocationName))
                {
                    log.AppendLine($"{item.NewLocationName,-50} -> {item.Name}" + (item.IsImportant ? "*" : "") + (item.IsRequired ? "*" : item.IsImportantSong ? "^" : ""));
                }
            }

            if (spoiler.MessageCosts.Count > 0)
            {
                log.AppendLine();
                log.AppendLine($" {"Name", -50}    Cost");
                foreach (var(name, cost) in spoiler.MessageCosts)
                {
                    log.AppendLine($"{name,-50} -> {cost}");
                }
            }


            if (spoiler.GossipHints != null && spoiler.GossipHints.Any())
            {
                log.AppendLine();
                log.AppendLine();

                log.AppendLine($" {"Gossip Stone",-25}    {"Message"}");
                foreach (var hint in spoiler.GossipHints.OrderBy(h => h.Key.ToString()))
                {
                    log.AppendLine($"{hint.Key,-25} -> {hint.Value}");
                }
            }

            using (StreamWriter sw = new StreamWriter(path))
            {
                sw.Write(log.ToString());
            }
        }
Exemplo n.º 7
0
        public void CanSetSpoilerText()
        {
            Spoiler spoiler = new Spoiler();

            spoiler.SpoilerText = "Spoilers!";

            Assert.Equal("Spoilers!", spoiler.SpoilerText);
        }
Exemplo n.º 8
0
        public void CanSetSpoilerUserName()
        {
            Spoiler spoiler = new Spoiler();

            spoiler.UserName = "******";

            Assert.Equal("JamesSmith", spoiler.UserName);
        }
Exemplo n.º 9
0
        private static void CreateTextSpoilerLog(Spoiler spoiler, string path)
        {
            StringBuilder log = new StringBuilder();

            log.AppendLine($"{"Version:",-17} {spoiler.Version}");
            log.AppendLine($"{"Settings String:",-17} {spoiler.SettingsString}");
            log.AppendLine($"{"Seed:",-17} {spoiler.Seed}");
            if (spoiler.CustomItemListString != null)
            {
                log.AppendLine($"{"Custom Item List:",-17} {spoiler.CustomItemListString}");
            }
            if (spoiler.CustomStartingItemListString != null)
            {
                log.AppendLine($"{"Custom Starting Item List:",-17} {spoiler.CustomStartingItemListString}");
            }
            log.AppendLine();

            if (spoiler.RandomizeDungeonEntrances)
            {
                log.AppendLine($" {"Entrance",-21}    {"Destination"}");
                log.AppendLine();
                string[] destinations = new string[] { "Woodfall", "Snowhead", "Inverted Stone Tower", "Great Bay" };
                for (int i = 0; i < 4; i++)
                {
                    log.AppendLine($"{destinations[i],-21} -> {destinations[spoiler.NewDestinationIndices[i]]}");
                }
                log.AppendLine("");
            }

            log.AppendLine($" {"Location",-50}    {"Item"}");
            foreach (var region in spoiler.ItemList.GroupBy(item => item.Region).OrderBy(g => g.Key))
            {
                log.AppendLine();
                log.AppendLine($" {region.Key}");
                foreach (var item in region.OrderBy(item => item.NewLocationName))
                {
                    log.AppendLine($"{item.NewLocationName,-50} -> {item.Name}");
                }
            }


            if (spoiler.GossipHints != null && spoiler.GossipHints.Any())
            {
                log.AppendLine();
                log.AppendLine();

                log.AppendLine($" {"Gossip Stone",-25}    {"Message"}");
                foreach (var hint in spoiler.GossipHints.OrderBy(h => h.Key.ToString()))
                {
                    log.AppendLine($"{hint.Key,-25} -> {hint.Value}");
                }
            }

            using (StreamWriter sw = new StreamWriter(path))
            {
                sw.Write(log.ToString());
            }
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            IVehicle         car = new HondaCity();
            VehicleDecorator vehicleDecorator = new SeatCover(car);

            vehicleDecorator = new Spoiler(vehicleDecorator);
            Console.WriteLine("Total Price : " + vehicleDecorator.GetPrice());
            Console.ReadLine();
        }
        public void GetTotalPrice_Amaze_MultipleDecorator_Test()
        {
            IVehicle         vehicle          = new Amaze();
            VehicleDecorator vehicleDecorator = new SeatCover(vehicle);

            vehicleDecorator = new Spoiler(vehicleDecorator);
            Assert.AreEqual(vehicle.GetDescription(), "Petrol engine is 1199 cc");
            Assert.AreEqual(vehicleDecorator.GetPrice(), 211000);
        }
        public void GetTotalPrice_HondaCity_MultipleDecorator_Test()
        {
            IVehicle         vehicle          = new HondaCity();
            VehicleDecorator vehicleDecorator = new SeatCover(vehicle);

            vehicleDecorator = new Spoiler(vehicleDecorator);
            Assert.AreEqual(vehicle.GetDescription(), "Petrol engine is 1497 cc");
            Assert.AreEqual(vehicleDecorator.GetPrice(), 111000);
        }
Exemplo n.º 13
0
    // Use this for initialization
    public void crearCarro()
    {
        Carroceria crr = new Carroceria();
        Ruedas     rue = new Ruedas();
        Spoiler    spo = new Spoiler();

        crr.crearcarroceria();
        rue.crearllantas();
        spo.crearspoiler();
    }
Exemplo n.º 14
0
        public void CreateSaleAndShowTheTotalPrice_ExpectedTotalPrice()
        {
            var myCar        = new Car("Camry");
            var myFeeature1  = new Spoiler("Spolier X", 500M, myCar);
            var myIncentive1 = new Coupon("SUMMERSALE", -100M, myCar);

            var aSale = new Sale(DateTime.Now, myCar, myFeeature1, myIncentive1);

            Assert.AreEqual(3, aSale.ItemsCount);
            Assert.AreEqual(15400M, aSale.TotalPrice);
        }
        public void Persist(RepositoryFactory repositoryFactory)
        {
            Spoiler spoiler = new Spoiler
            {
                Title       = this.Title,
                Description = this.Description,
                Image       = this.Image,
                BookId      = this.BookId
            };

            repositoryFactory.GetSpoilerRepository().Save(spoiler);
        }
Exemplo n.º 16
0
    public int GetPrice(Spoiler spoiler)
    {
        switch (spoiler)
        {
        case Spoiler.Disabled:
            return(0);

        case Spoiler.Standard:
            return(2000);

        default:
            return(0);
        }
    }
Exemplo n.º 17
0
        public void CreateSellabeItemsAndDecorateThemWithExtraFeatures_ExpectedPrice()
        {
            var myCar = new Car("Camry");

            Assert.AreEqual(15000M, myCar.Price);

            var myFeeature1 = new Spoiler("Spolier X", 500M, myCar);

            Assert.AreEqual(500M, myFeeature1.Price);

            var myIncentive1 = new Coupon("SUMMERSALE", -100M, myCar);

            Assert.AreEqual(-100M, myIncentive1.Price);
        }
Exemplo n.º 18
0
        private static void CreateTextSpoilerLog(Spoiler spoiler, string path)
        {
            StringBuilder log = new StringBuilder();

            log.AppendLine($"{"Version:",-17} {spoiler.Version}");
            log.AppendLine($"{"Settings String:",-17} {spoiler.SettingsString}");
            log.AppendLine($"{"Seed:",-17} {spoiler.Seed}");
            if (spoiler.CustomItemListString != null)
            {
                log.AppendLine($"{"Custom Item List:",-17} {spoiler.CustomItemListString}");
            }
            log.AppendLine();

            if (spoiler.RandomizeDungeonEntrances)
            {
                log.AppendLine($" {"Entrance",-21}    {"Destination"}");
                log.AppendLine();
                string[] destinations = new string[] { "Woodfall", "Snowhead", "Inverted Stone Tower", "Great Bay" };
                for (int i = 0; i < 4; i++)
                {
                    log.AppendLine($"{destinations[i],-21} -> {destinations[spoiler.NewDestinationIndices[i]]}");
                }
                log.AppendLine("");
            }

            log.AppendLine($" {"Location",-50}    {"Item"}");
            foreach (var item in spoiler.ItemList)
            {
                log.AppendLine($"{item.NewLocationName,-50} -> {item.Name}");
            }

            log.AppendLine();
            log.AppendLine();

            log.AppendLine($" {"Location",-50}    {"Item"}");
            foreach (var item in spoiler.ItemList.OrderBy(i => i.NewLocationId))
            {
                log.AppendLine($"{item.NewLocationName,-50} -> {item.Name}");
            }

            using (StreamWriter sw = new StreamWriter(path))
            {
                sw.Write(log.ToString());
            }
        }
Exemplo n.º 19
0
        public async Task <IActionResult> PostSpoiler([FromBody] Spoiler spoiler)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var movie = await _movieContext.GetMovieOrCreate(spoiler.MovieID, false);

            if (movie == null)
            {
                return(BadRequest("Movie does not exist."));
            }

            await _spoilerContext.CreateSpoiler(spoiler);

            return(CreatedAtAction("GetSpoiler", new { id = spoiler.ID }, spoiler));
        }
Exemplo n.º 20
0
        public async void CanCreateSpoiler()
        {
            DbContextOptions <SpoiltContext> options =
                new DbContextOptionsBuilder <SpoiltContext>()
                .UseInMemoryDatabase("GetSpoilerText")
                .Options;

            using (SpoiltContext context = new SpoiltContext(options))
            {
                Spoiler spoiler = new Spoiler();
                spoiler.SpoilerText = "Spoilers!";

                context.Spoilers.Add(spoiler);
                await context.SaveChangesAsync();

                Assert.True(await context.Spoilers.AnyAsync(x => x.ID == spoiler.ID));
            }
        }
Exemplo n.º 21
0
    public Modifications()
    {
        OwnedPaintTypes.Add(PaintType.Glossy);
        SelectedPaintType = PaintType.Glossy;

        OwnedSpoilers.Add(Spoiler.Disabled);
        SelectedSpoiler = Spoiler.Disabled;

        OwnedPaintColors.Add(PaintColor.Red);
        SelectedPaintColor = PaintColor.Red;

        OwnedStickers.Add(Sticker.Disabled);
        SelectedSticker = Sticker.Disabled;

        OwnedFrontSpoilers.Add(FrontSpoiler.Disabled);
        SelectedFrontSpoiler = FrontSpoiler.Disabled;

        OwnedEngines.Add(Engine.V6);
        SelectedEngine = Engine.V6;
    }
Exemplo n.º 22
0
        public static void CreateSpoilerLog(RandomizedResult randomized, Settings settings)
        {
            var itemList = randomized.ItemList
                           .Where(u => u.ReplacesAnotherItem)
                           .Select(u => new SpoilerItem(u)
            {
                ReplacedById = randomized.ItemList.Single(i => i.ReplacesItemId == u.ID).ID
            })
                           .ToList();
            var settingsString = settings.ToString();

            var directory = Path.GetDirectoryName(settings.OutputROMFilename);
            var filename  = $"{Path.GetFileNameWithoutExtension(settings.OutputROMFilename)}";

            Spoiler spoiler = new Spoiler()
            {
                Version                   = MainForm.AssemblyVersion.Substring(26),
                SettingsString            = settingsString,
                Seed                      = settings.Seed,
                RandomizeDungeonEntrances = settings.RandomizeDungeonEntrances,
                ItemList                  = itemList,
                NewDestinationIndices     = randomized.NewDestinationIndices,
                Logic                     = randomized.Logic
            };

            if (settings.GenerateHTMLLog)
            {
                filename += "_SpoilerLog.html";
                using (StreamWriter newlog = new StreamWriter(Path.Combine(directory, filename)))
                {
                    Templates.HtmlSpoiler htmlspoiler = new Templates.HtmlSpoiler(spoiler);
                    newlog.Write(htmlspoiler.TransformText());
                }
            }
            else
            {
                filename += "_SpoilerLog.txt";
                CreateTextSpoilerLog(spoiler, Path.Combine(directory, filename));
            }
        }
Exemplo n.º 23
0
        public async void CanDeleteSpoiler()
        {
            DbContextOptions <SpoiltContext> options =
                new DbContextOptionsBuilder <SpoiltContext>()
                .UseInMemoryDatabase("SpoilerDelete")
                .Options;

            using (SpoiltContext context = new SpoiltContext(options))
            {
                Spoiler spoiler = new Spoiler();
                spoiler.SpoilerText = "Spoilers!";

                context.Spoilers.Add(spoiler);
                await context.SaveChangesAsync();

                context.Spoilers.Remove(spoiler);
                await context.SaveChangesAsync();

                var spoilerText = await context.Spoilers.ToListAsync();

                Assert.DoesNotContain(spoiler, spoilerText);
            }
        }
Exemplo n.º 24
0
 public HtmlSpoiler(Spoiler spoiler)
 {
     this.spoiler = spoiler;
 }
Exemplo n.º 25
0
        private void ParseComponent(string tag, string attributes, string value)
        {
            value = this.FormatHTML(value);

            if (tag != null)
            {
                tag = tag.ToLower();
            }

            Component element = null;

            switch (tag)
            {
            case "u":
                element = new Underline();
                break;

            case "i":
                element = new Italic();
                break;

            case "b":
                element = new Bold();
                break;

            case "strike":
                element = new Strike();
                break;

            case "h1":
                element = new Title();
                break;

            case "url":
                element = new URL();
                break;

            case "spoiler":
                element = new Spoiler();
                break;

            case "noparse":
                element = new NoParse();
                break;

            case "code":
                element = new Code();
                break;

            case "quote":
                element = new Quote();
                break;

            case "olist":
                element = new List();
                break;

            case "list":
                element = new List();
                break;

            case "img":
                element = new Image();
                break;

            default:
                element = new PlainText();
                break;
            }

            if (element != null)
            {
                element.Create(value, attributes);

                /*if (global.options.newLine) {
                 *  result = result.toString().replace(/\r ?\n / g, '<br />')
                 *
                 * }*/
                this.components.Add(element);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Updates the spoiler.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="spoiler">The spoiler.</param>
        /// <returns>
        /// Returns the Spoiler that was Updated
        /// </returns>
        public Task <Spoiler> UpdateSpoiler(int id, Spoiler spoiler)
        {
            _context.Entry(spoiler).State = EntityState.Modified;

            return(RetrieveSpoiler(id));
        }
Exemplo n.º 27
0
        public static void CreateSpoilerLog(RandomizedResult randomized, GameplaySettings settings, OutputSettings outputSettings)
        {
            var itemList = randomized.ItemList
                           .Where(io => !io.Item.IsFake() && io.NewLocation.HasValue)
                           .Select(u => new SpoilerItem(u, ItemUtils.IsRequired(u.Item, randomized), ItemUtils.IsImportant(u.Item, randomized), settings.ProgressiveUpgrades));

            Dictionary <Item, Item> dungeonEntrances = new Dictionary <Item, Item>();

            if (settings.RandomizeDungeonEntrances)
            {
                var entrances = new List <Item>
                {
                    Item.AreaWoodFallTempleAccess,
                    Item.AreaSnowheadTempleAccess,
                    Item.AreaGreatBayTempleAccess,
                    Item.AreaInvertedStoneTowerTempleAccess,
                };
                foreach (var entrance in entrances.OrderBy(e => entrances.IndexOf(randomized.ItemList[e].NewLocation.Value)))
                {
                    dungeonEntrances.Add(randomized.ItemList[entrance].NewLocation.Value, entrance);
                }
            }
            var settingsString = settings.ToString();

            var directory = Path.GetDirectoryName(outputSettings.OutputROMFilename);
            var filename  = $"{Path.GetFileNameWithoutExtension(outputSettings.OutputROMFilename)}";

            var     plainTextRegex = new Regex("[^a-zA-Z0-9' .\\-]+");
            Spoiler spoiler        = new Spoiler()
            {
                Version          = Randomizer.AssemblyVersion,
                SettingsString   = settingsString,
                Seed             = randomized.Seed,
                DungeonEntrances = dungeonEntrances,
                ItemList         = itemList.ToList(),
                Logic            = randomized.Logic,
                GossipHints      = randomized.GossipQuotes?.ToDictionary(me => (GossipQuote)me.Id, (me) =>
                {
                    var message     = me.Message.Substring(1);
                    var soundEffect = message.Substring(0, 2);
                    message         = message.Substring(2);
                    if (soundEffect == "\x69\x0C")
                    {
                        // real
                    }
                    else if (soundEffect == "\x69\x0A")
                    {
                        // fake
                        message = "FAKE - " + message;
                    }
                    else
                    {
                        // junk
                        message = "JUNK - " + message;
                    }
                    return(plainTextRegex.Replace(message.Replace("\x11", " "), ""));
                }),
            };

            if (outputSettings.GenerateHTMLLog)
            {
                using (StreamWriter newlog = new StreamWriter(Path.Combine(directory, filename + "_Tracker.html")))
                {
                    Templates.HtmlSpoiler htmlspoiler = new Templates.HtmlSpoiler(spoiler);
                    newlog.Write(htmlspoiler.TransformText());
                }
            }

            if (outputSettings.GenerateSpoilerLog)
            {
                CreateTextSpoilerLog(spoiler, Path.Combine(directory, filename + "_SpoilerLog.txt"));
            }
        }
Exemplo n.º 28
0
        public override List <string> ToArgs()
        {
            var args = base.ToArgs();

            if (!string.IsNullOrEmpty(QueryNot))
            {
                args.Add($"q:not={QueryNot}");
            }

            if (!string.IsNullOrEmpty(Title))
            {
                args.Add($"title={Title}");
            }

            if (!string.IsNullOrEmpty(TitleNot))
            {
                args.Add($"title:not={TitleNot}");
            }

            if (!string.IsNullOrEmpty(Selftext))
            {
                args.Add($"selftext={Selftext}");
            }

            if (!string.IsNullOrEmpty(SelftextNot))
            {
                args.Add($"selftext:not={SelftextNot}");
            }

            if (!string.IsNullOrEmpty(Score))
            {
                args.Add($"score={Score}");
            }

            if (!string.IsNullOrEmpty(NumComments))
            {
                args.Add($"num_comments={NumComments}");
            }

            if (Over18.HasValue)
            {
                args.Add($"over_18={Over18.ToString().ToLower()}");
            }

            if (IsVideo.HasValue)
            {
                args.Add($"is_video={IsVideo.ToString().ToLower()}");
            }

            if (Locked.HasValue)
            {
                args.Add($"locked={Locked.ToString().ToLower()}");
            }

            if (Stickied.HasValue)
            {
                args.Add($"stickied={Stickied.ToString().ToLower()}");
            }

            if (Spoiler.HasValue)
            {
                args.Add($"spoiler={Spoiler.ToString().ToLower()}");
            }

            if (ContestMode.HasValue)
            {
                args.Add($"contest_mode={ContestMode.ToString().ToLower()}");
            }

            return(args);
        }