예제 #1
0
        public static void edit(string[] words)
        {
            IPriority pr;

            if (words != null && words.Length != 0)
            {
                int totalScore = 0;
                for (int i = 0; i < words.Length; i += 2)
                {
                    pr          = PriorityFactory.createPriority("" + words[i], "" + words[i + 1]);
                    totalScore += pr.getScore();
                }
                if (indexPoint.ContainsKey(index)) //bu index daha önce eklenmiş ise editleriz
                {
                    indexPoint[index] = totalScore;
                }
            }
        }
예제 #2
0
        public static ArrayList output = new ArrayList(); //tüm işlemleri tutuyoruz. Yazma Formatını da kolaylıkla değiştirmemizi sağlıyor

        public static void add(string[] words)
        {
            IPriority pr;

            if (words != null && words.Length != 0)
            {
                int totalScore = 0;
                for (int i = 0; i < words.Length; i += 2)
                {
                    pr          = PriorityFactory.createPriority("" + words[i], "" + words[i + 1]);
                    totalScore += pr.getScore();
                }
                if (!indexPoint.ContainsKey(index)) // aynı index tekrar eklenemez
                {
                    indexPoint.Add(index, totalScore);
                }
            }
        }