public Phase NextPhase(BossLocationType phaseChosen) { CurrentPhase = PossiblePhases(phaseChosen).Single(); PhaseDescisionInputRequired = false; return(CurrentPhase); }
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); }
public void NextPhaseByLocation(BossLocationType bossLocation) { if (PhaseDecisionRequired) { var tempRotations = _possibleRotations.Where(r => r.NextPhase.BossLocation == bossLocation).ToList(); if (tempRotations.Count != 0) { _possibleRotations = tempRotations; } var phases = GetPossiblePhases(); if (phases.Count == 1) { IncreasePhaseIndex(); OnPhaseChanged?.Invoke(_possibleRotations.First()); } else { OnPhaseDecisionRequired?.Invoke(phases, PhaseSameAttackStyle); } } }