private DisplayPlayingField CreateSut([NotNull] IHintField hintField, [NotNull] IPlayingField playingField) { var sut = new DisplayPlayingField(hintField, playingField); return(sut); }
private void CreateCommon() { IHintField hintField = m_HintFieldFactory.Create(m_MineField); m_PlayingField = m_PlayingFieldFactory.Create(m_MineField); m_UserOutput = m_UserOutputFactory.Create(hintField, m_PlayingField); }
public UserOutput([NotNull] IConsole console, [NotNull] IDisplayPlayingFieldFactory factory, [NotNull] IHintField hintField, [NotNull] IPlayingField playingField) { m_Console = console; m_DisplayPlayingFieldField = factory.Create(hintField, playingField); }
public UserOutput([NotNull] IConsole console, [NotNull] Func <IHintField, IPlayingField, IDisplayPlayingField> factory, [NotNull] IHintField hintField, [NotNull] IPlayingField playingField) { m_Console = console; m_DisplayPlayingFieldField = factory(hintField, playingField); }
private void CreateCommon() { HintField = m_HintFieldFactory(m_MineField); // todo test setting field m_PlayingField = m_PlayingFieldFactory(m_MineField); m_UserOutput = m_UserOutputFactory(HintField, m_PlayingField); }
public override List <Square> TrySolve(IPlayingField field) { _field = field; var modifiedSquares = new List <Square>(); SetSingleOccurance(field.GetRow, modifiedSquares); SetSingleOccurance(field.GetColumn, modifiedSquares); SetSingleOccurance(field.GetBigSquare, modifiedSquares); return(modifiedSquares.Distinct().ToList()); }
public override List <Square> TrySolve(IPlayingField field) { var run = true; var modifiedSquares = new List <Square>(); while (run) { run = false; FilterCandidates(field.GetRow, ref run, modifiedSquares); FilterCandidates(field.GetColumn, ref run, modifiedSquares); FilterCandidates(field.GetBigSquare, ref run, modifiedSquares); foreach (var square in modifiedSquares.Where(x => x.Candidates.Count == 1)) //todo: && value == 0, but how to test? guess I could extract interface for square and verify { square.Value = square.Candidates[0]; } } return(modifiedSquares.Distinct().ToList()); }
private IUserOutput UserOutputFactory( IHintField hintField, IPlayingField playingField) { return(m_UserOutput); }
public DisplayPlayingField([NotNull] IHintField hintField, [NotNull] IPlayingField playingField) { m_HintField = hintField; m_PlayingField = playingField; }
protected PlayingFieldTests() { _field = new PlayingField(FieldDefinition); }
private IDisplayPlayingField DisplayPlayingFieldFactory( IHintField hintField, IPlayingField playingField) { return(m_DisplayPlayingField); }