예제 #1
0
        public void IncrementRootCount(string root, int count = 1)
        {
            if (!RootCounts.ContainsKey(root))
            {
                RootCounts.Add(root, 0);
            }

            RootCounts[root] += count;
        }
예제 #2
0
        public void DecrementRootCount(string root, int count = 1)
        {
            if (!RootCounts.ContainsKey(root))
            {
                RootCounts.Add(root, 0);
            }

            RootCounts[root] -= count;

            if (RootCounts[root] < 0)
            {
                RootCounts[root] = 0;
            }
        }