public static int LayerFloodFill(Layer <int> layer, Point <int> start, int targetColor, int fillColor) { return(LayerFloodFill( layer, start, point => layer.Get(point) == targetColor, // fillCondition point => layer.Set(point, fillColor) // fillAction )); }
public Layer(Layer <T> rhs) { tiles = new T[rhs.size.x, rhs.size.y]; this.min = rhs.min; this.size = rhs.size; ForEachFromBottom((x, y, tile) => { //KAI: this is a shallow copy. Not sure how to represent this fact Set(x, y, rhs.Get(x, y)); }); }
public static int LayerFloodFill(Layer <int> layer, Point <int> start, int fillColor) { return(LayerFloodFill(layer, start, layer.Get(start), fillColor)); }