コード例 #1
0
ファイル: MyCat.cs プロジェクト: jackjet870/Gabriel.NewMyCat
        private void AddTransction(Even root, Transaction node)
        {
            var countT = root.Transactions.Count;

            if (countT == 0)
            {
                root.NewTransaction(node);
                return;
            }
            if (countT > 0)
            {
                var currentT = root.Transactions[countT - 1];
                if (currentT.Depth == 0)
                {
                    root.NewTransaction(node);
                    return;
                }
                var countE = currentT.Evens.Count;
                if (countE == 0)
                {
                    root.NewTransaction(node);
                    return;
                }
                var currentE = currentT.Evens[countE - 1];
                AddTransction(currentE, node);
                currentT.Depth++;
            }
        }