private Mystery _getNextMystery(Func <Mystery, LockedMystery> lockMystery) { var mystery = FreeMysteries.ElementAt(0); foreach (var lMystery in LockedMysteries) { if (!lMystery.IsLocked()) { mystery = lMystery.Mystery; LockedMysteries.Remove(lMystery); break; } } if (mystery != Mystery.Empty) { FreeMysteries.Remove(mystery); LockedMysteries.Add(lockMystery(mystery)); } return(mystery); }
public void Finish(Mystery mystery) { FinishedMysteries.Add(mystery); FreeMysteries.Remove(mystery); LockedMysteries.RemoveAll(lm => lm.Mystery == mystery); }