Ejemplo 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;
        }
Ejemplo 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;
        }