Example #1
0
        public void NoDesription_Parses()
        {
            var           str = "no_description current_endurance_charges";
            NoDescription res = (NoDescription)StatDescriptionParser.ParseNoDescription(str);

            Assert.Equal("current_endurance_charges", res.Stat);
        }
Example #2
0
        public void Include_Parses()
        {
            var     actual = "Metadata/blabla";
            Include e      = (Include)StatDescriptionParser.ParseInclude($"include \"{actual}\"");

            Assert.Equal(actual, e.File);
        }
Example #3
0
        public void Description_Parses()
        {
            var str = @"description dklwqmdlkw
	1 base_poison_damage_+%
	2
		1|# ""This Attack and Minions have %1%%% increased Damage with Poison"" reminderstring ReminderTextPoison
		#|-1 ""This Attack and Minions have %1%%% reduced Damage with Poison"" reminderstring ReminderTextPoison
	lang ""Portuguese""
	2
		1|# ""Este Ataque e Lacaios têm %1%%% de Dano com Veneno aumentado"" reminderstring ReminderTextPoison
		#|-1 ""Este Ataque e Lacaios têm %1%%% de Dano com Veneno reduzido"" reminderstring ReminderTextPoison"        ;

            Description res = (Description)StatDescriptionParser.ParseDescription(str);

            Assert.Equal(2, res.Languages.Count);
            Assert.Equal(1, res.Stats.Count);
            Assert.Equal("dklwqmdlkw", res.Name);

            str = @"description
	1 base_poison_damage_+%
	2
		1|# ""This Attack and Minions have %1%%% increased Damage with Poison"" reminderstring ReminderTextPoison
		#|-1 ""This Attack and Minions have %1%%% reduced Damage with Poison"" reminderstring ReminderTextPoison
	lang ""Portuguese""
	2
		1|# ""Este Ataque e Lacaios têm %1%%% de Dano com Veneno aumentado"" reminderstring ReminderTextPoison
		#|-1 ""Este Ataque e Lacaios têm %1%%% de Dano com Veneno reduzido"" reminderstring ReminderTextPoison"        ;

            res = (Description)StatDescriptionParser.ParseDescription(str);
            Assert.Equal(2, res.Languages.Count);
            Assert.Equal(1, res.Stats.Count);
            Assert.Equal("", res.Name);
        }
Example #4
0
        public void StatsDescription_File_Parses()
        {
            var str = CompleteStatsDescriptionTestString.Replace("\r\n", "\n");
            var res = StatDescriptionParser.ParseInstructions(str).ToList();

            Assert.Equal(9, res.Count);
        }
Example #5
0
        public void Params_Parses()
        {
            var str = "2 base_chance_to_freeze_% always_freeze";
            var res = StatDescriptionParser.ParseStats(str).ToList();

            Assert.Equal(2, res.Count);
            Assert.Equal("base_chance_to_freeze_%", res[0]);
            Assert.Equal("always_freeze", res[1]);
        }
Example #6
0
        public void Range_Parses()
        {
            var str = @"#|-1 ""This Attack and Minions have % 1 %%% reduced Attack Speed"" negate 1";
            var res = StatDescriptionParser.ParseVariation(str);

            Assert.Equal("#|-1", res.RangeText);
            Assert.Equal("This Attack and Minions have % 1 %%% reduced Attack Speed", res.TranslationTemplate);
            Assert.Equal("negate 1", res.ExtraInstructions);
        }
Example #7
0
        static void Main(string[] args)
        {
            var sw = Stopwatch.StartNew();

            // Point to your stat_description.txt
            const string filePath =
                @"C:\noindex\3124\Bundles2\Bundles2\Metadata\" +
                @"StatDescriptions\stat_descriptions.txt";

            var instructions = StatDescriptionParser
                               .ParseInstructions(File.ReadAllText(filePath));

            var elapsed = sw.Elapsed;

            Console.WriteLine(elapsed);
        }
Example #8
0
        public void Language_Parses()
        {
            var str = @"	2
		1|# ""%1%%% increased Quantity of Items Dropped by enemies Slain by Minions or This Attack""
		#|-1 ""%1%%% reduced Quantity of Items Dropped by enemies Slain by Minions or This Attack"" negate 1 bladi 2"        ;

            var res = StatDescriptionParser.ParseLanguage(str);

            Assert.Equal(2, res.Variations.Count);

            Assert.Equal("%1%%% increased Quantity of Items Dropped by enemies Slain by Minions or This Attack", res.Variations[0].TranslationTemplate);
            Assert.Equal("1|#", res.Variations[0].RangeText);
            Assert.Equal("", res.Variations[0].ExtraInstructions);

            Assert.Equal("%1%%% reduced Quantity of Items Dropped by enemies Slain by Minions or This Attack", res.Variations[1].TranslationTemplate);
            Assert.Equal("#|-1", res.Variations[1].RangeText);
            Assert.Equal("negate 1 bladi 2", res.Variations[1].ExtraInstructions);

            Assert.Equal("English", res.Name);
        }