Exemple #1
0
 public static Vector2 Reduce3x3(Vector2 curr_cell, Reduce3x3Callback <Vector2> callback)
 {
     return(UMatrix.Reduce3x3 <Vector2>(
                curr_cell,
                (prev, curr) => curr_cell == curr ? prev : callback(prev, curr),
                curr_cell
                ));
 }
Exemple #2
0
        public static T Reduce3x3 <T>(Vector2 curr_cell, Reduce3x3Callback <T> callback, T initial)
        {
            T result = initial;

            UMatrix.ForEach3x3(curr_cell, curr_neighbour => {
                result = callback(result, curr_neighbour);
            });

            return(result);
        }
Exemple #3
0
 public static void ForEachRotated(Vector2 size, ForEachXYCallback xy_callback) =>
 UMatrix.ForEachRotated(size, (y) => { }, xy_callback);
Exemple #4
0
 public static void ForEachRotated(Vector2 size, ForEachYCallback y_callback, ForEachXYCallback xy_callback) =>
 UMatrix.ForEach(new Vector2(size.Y, size.X), (y) => y_callback(y), (x, y) => xy_callback(y, x));
Exemple #5
0
 public static void ForEach(Vector2 size, ForEachXYCallback xy_callback) =>
 UMatrix.ForEach(size, (x) => { }, xy_callback);