Пример #1
0
        public bool IsPriorityOrdered(Spell s1, Spell s2)
        {
            int i1 = Priorities.IndexOf(s1);
            int i2 = Priorities.IndexOf(s2);

            return((i1 < i2 && i1 != -1) || (i1 != -1 && i2 == -1));
        }
Пример #2
0
        public override int vote()
        {
            //List<List<int>> currentState = CurGame.votedBy;
            int randomNumber = CurGame._rnd.Next(1, initialState.Sum() + 1);
            int ans          = 1;

            foreach (int cand in initialState)
            {
                if (randomNumber <= cand)
                {
                    return(Priorities.IndexOf(ans));
                }
                randomNumber -= cand;
                ans++;
            }
            return(Priorities.IndexOf(ans));
        }