Esempio n. 1
0
        private void Previous()
        {
            Combatant activeCombatant = Combatants.FirstOrDefault(c => c.IsActive);

            activeCombatant.IsActive = false;
            int index = Combatants.IndexOf(activeCombatant);

            if (index == 0)
            {
                index = Combatants.Count - 1;
            }
            else
            {
                index--;
            }
            Combatants[index].IsActive = true;
        }
Esempio n. 2
0
        private void Next()
        {
            Combatant activeCombatant = Combatants.FirstOrDefault(c => c.IsActive);

            activeCombatant.IsActive = false;
            int index = Combatants.IndexOf(activeCombatant);

            if (index == Combatants.Count - 1)
            {
                index = 0;
            }
            else
            {
                index++;
            }
            Combatants[index].IsActive = true;
        }