示例#1
0
                    public override IEnumerable <IState> Successors()
                    {
                        var newColor = (_color + 1) % Colors;

                        // ReSharper disable once ImpureMethodCallOnReadonlyValueField
                        return(_location.Neighbors().
                               Where(loc => !_solver._isBlocked[loc.Row][loc.Col]).
                               Select(loc => new MonocycleState(newColor, loc, NewDirection(_location, loc), _solver)));
                    }
 public IEnumerable <IState> Successors()
 {
     return(_location.Neighbors()
            .Where(IsClear)
            .Select(l => new Position(l)));
 }