public IEnumerable<Field> CurrentPlayerPlaces(IPlaceBlackStone blackStonePlacer) { var currentPlayer = _playersState.CurrentPlayer; var targetBorder = currentPlayer.GetTargetBorder(_fieldsGraph); return targetBorder.Select(() => blackStonePlacer.UpperIsTarget(_fieldsGraph), () => blackStonePlacer.BottomIsTarget(_fieldsGraph)) .Distinct() .Where(_fieldsGraph.CanPlaceBlackStone) .Select(_fieldsGraph.GetField); }
public IEnumerable <Field> CurrentPlayerPlaces(IPlaceBlackStone blackStonePlacer) { var currentPlayer = _playersState.CurrentPlayer; var targetBorder = currentPlayer.GetTargetBorder(_fieldsGraph); return(targetBorder.Select(() => blackStonePlacer.UpperIsTarget(_fieldsGraph), () => blackStonePlacer.BottomIsTarget(_fieldsGraph)) .Distinct() .Where(_fieldsGraph.CanPlaceBlackStone) .Select(_fieldsGraph.GetField)); }
public IEnumerable <Tuple <int, int> > UpperIsTarget(IFieldsGraph fieldsGraph) { return(_first.UpperIsTarget(fieldsGraph).Concat(_right.UpperIsTarget(fieldsGraph))); }