Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var multi = new Multiplicar(new List <int> {
                3, 2, 1
            });

            Console.WriteLine(multi.ToString());

            var addition = new ListAddition();

            Console.WriteLine($"The value can be sum:{addition.CanItBeSum(25, new List<int> { 10, 15, 3, 7 })}");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化加成和棋子的数据
        /// </summary>
        /// <param name="linesChessPieces"></param>
        /// <param name="linesAddition"></param>
        public void InitData(List <string> linesChessPieces, List <string> linesAddition)
        {
            ListChessPieces.Clear();
            foreach (var line in linesChessPieces)
            {
                var strs = line?.Split(',');
                if (strs?.Length < 7)
                {
                    continue;
                }
                var i = 0;
                ListChessPieces.Add(new ChessPieces()
                {
                    Name       = strs[i++],
                    Race1      = strs[i++],
                    Race2      = strs[i++],
                    Profession = strs[i++],
                    Level      = strs[i++],
                    Attack     = strs[i++],
                    Skill      = strs[i++],
                });
            }

            ListAddition.Clear();
            foreach (var line in linesAddition)
            {
                var strs = line?.Split(',');
                if (strs?.Length < 3)
                {
                    continue;
                }
                var i   = 0;
                var add = new Addition()
                {
                    Name    = strs[i++],
                    Number  = int.Parse(strs[i++]),
                    Content = strs[i++],
                };
                ListAddition.Add(add);
                if (add.Content.Contains("所有友方恶魔为同一种类"))
                {
                    DemonAssNum = add.Number;
                }
            }

            ListChessPieces.Sort((s, s1) => s.Profession.CompareTo(s1.Profession));

            ListQuery = ListChessPieces.Select(b => b.QueryText).ToList();
        }