public List <Phase> PossiblePhases(BossLocationType bossLocation) { PossibleRotations = PossibleRotations.Where(r => r.Phases[_phaseIndex].BossLocation == bossLocation).ToList(); //Get only distinct phases (otherwise you'd get two melee phases with same positioning for first round). var result = PossibleRotations.Select(p => p.Phases[_phaseIndex + 1]) .GroupBy(p => new { p.BossLocation, p.Style }) .Select(p => p.First()).ToList(); _phaseIndex++; PhaseSameAttackStyle = result.Count != result.GroupBy(s => s.Style).Count(); return(result); }
/// <summary> /// Used to select the next phase in zulrah's rotation. The Rotation must be found in order for this method to work, otherwise use PossiblePhase to find the correct tree. /// </summary> /// <returns>The next phase in Zulrah's rotation</returns> public Phase NextPhase() { //Reset to first phase if you hit the end of the rotation and are still killing zulrah. if (IsLastPhase()) { _phaseIndex = 0; } if (RotationFound) { CurrentPhase = PossibleRotations.Select(p => p.Phases[_phaseIndex + 1]).Single(); } else { PhaseDescisionInputRequired = true; throw new InvalidOperationException(); } _phaseIndex++; return(CurrentPhase); }