public bool IsSequential() { if (!Sequences.Any()) { return(false); } var startsAfterFrom = Sequences[0] - From == 1; return(startsAfterFrom && IsCompletelySequential(Sequences)); }
public long LastEncountered() { var candidate = NextKnownSequence > 0 ? NextKnownSequence - 1 : LastKnownSequence; if (candidate > 0) { return(candidate); } if (Sequences.Any()) { return(Sequences.Last()); } return(From); }
public List <Tuple <DateTime, Lot> > GetLotStarts() { if (!Sequences.Any()) { throw new Exception("Sequences has to be filled before getting lot starts"); } else if (RealLotStarts == null) { throw new Exception("WaferFabSettings does not contain real lot starts. Either run simulation without real lot starts or load them from a serialized file."); } List <Tuple <DateTime, Lot> > lotStarts = new List <Tuple <DateTime, Lot> >(); DateTime time = InitialTime == null ? DateTime.MinValue : (DateTime)InitialTime; foreach (var real in RealLotStarts.Where(x => x.Item1 >= InitialTime)) { lotStarts.Add(new Tuple <DateTime, Lot>(real.Item1, real.Item2.ConvertToLot(0, Sequences, true, InitialTime))); } return(lotStarts.Where(x => x.Item2 != null).ToList()); }
private async Task SelectSequenceAsync() { if (Sequences.Any()) { var result = await _dialogService.ShowSelectionDialogAsync( Sequences, Translate("SelectSequence"), Translate("Cancel"), _disappearingTokenSource.Token); if (result.IsOk) { Action.SequenceName = result.SelectedItem; } } else { await _dialogService.ShowMessageBoxAsync( Translate("Warning"), Translate("NoSequences"), Translate("Ok"), _disappearingTokenSource.Token); } }
private bool GameWonBy(Mark mark) => Sequences.Any(sequence => SequenceFilledByMark(mark, sequence));
public long Ending() { return(Sequences.Any() ? To : From); }