public void Set(Texture2DI resource) { var texture = (Texture2D)resource; video.currentPixelTextures[index] = texture; this.texture = new WeakReference(texture); Apply = setTexture2D; }
public void Set(float[] values) { valueArrayOffset = 0; valueArrayCount = values.Length; valueArrayObject.Target = values; Apply = setFloatArray; }
public void Set(Vector4[] values, int offset, int count) { valueArrayOffset = offset; valueArrayCount = count; valueArrayObject.Target = values; Apply = setVector4Array; }
public void Set(Vector4[] values) { valueArrayOffset = 0; valueArrayCount = values.Length; valueArrayObject.Target = values; Apply = setVector4Array; }
public void Set(float[] values, int offset, int count) { valueArrayOffset = offset; valueArrayCount = count; valueArrayObject.Target = values; Apply = setFloatArray; }
public application(ApplyFunc pre = default, ApplyFunc post = default, Cursor cursor = default, iterator iter = default) { this.pre = pre; this.post = post; this.cursor = cursor; this.iter = iter; }
public void Set(float x, float y, float z) { valueObject.X = x; valueObject.Y = y; valueObject.Z = z; Apply = setVector3; }
public void Set(Matrix4[] values, int count) { valueArrayOffset = 0; valueArrayCount = count; valueArrayObject.Target = values; Apply = setMatrix4Array; }
public ShaderVariable(int location, string name) { this.location = location; this.Name = name; Apply = setNothing; valueArrayObject = new WeakReference(null); }
public ShaderResource(VideoI video, int index, string name) { this.video = (Video)video; this.index = index; this.Name = name; Apply = setNothing; }
public static IEnumerable <T> Apply <T>(this IEnumerable <T> enumerable, ApplyFunc <T> apply) { List <T> list = enumerable.ToList(); list.ForEach(element => apply(element)); return(list); }
public void Set(float x, float y, float z, float w) { valueObject.X = x; valueObject.Y = y; valueObject.Z = z; valueObject.W = w; Apply = setVector4; }
public void Apply_should_take_no_operand_and_fail(int[] data, ApplyFunc apply) { try { apply(data); } catch (AssertException) { Assert.Pass(); } }
public void Set(ITexture2D resource) { var texture = (Texture2D)resource; video.currentTextures[index] = texture; resourceIndex = texture.Texture; this.texture = new WeakReference(texture); Apply = setTexture2D; }
public ShaderVariable(ShaderProgram program, int index, string name) { this.program = program; this.index = index; this.Name = name; Apply = setNothing; valueArrayObject = new WeakReference(null); }
public ShaderResource(IVideo video, int location, int index, string name) { this.video = (Video)video; this.location = location; this.index = index; this.Name = name; Apply = setNothing; }
public static void Test() { ApplyFunc((Func <dynamic, dynamic>)Printing.Println, true, "1", 2, 0.3, '4', (5, 6), new string[] { "1", "2", "3" } // It won't work because it is calling Printing.Println<T> // instead of calling Print.Println<T[]> // This is the problem with this function, // it cannot dynamically call other methods suitable for the value. ).ln(); // But It one is work // And it will dynamically call other methods suitable for the value. ApplyFunc(ele => Printing.Println(ele), false, "42", 98765432, 0.123456789, '0', (1, 2.3, "4", '5'), ' ', new string[] { "a", "b", "c" }, ' ', new int[, ] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }, ' ', new int[][] { new[] { 4 }, new[] { 4, 5 }, new[] { 4, 5, 6 } } );; }
public void Set(Matrix4 value) { valueObject.Matrix4 = value; Apply = setMatrix4; }
public void Set(Matrix2 value) { valueObject.Matrix2 = value; Apply = setMatrix2; }
public void Set(Vector3 value) { valueObject.Vector3 = value; Apply = setVector3; }
public void Set(float x, float y) { valueObject.X = x; valueObject.Y = y; Apply = setVector2; }
public void Set(Vector2 value) { valueObject.Vector2 = value; Apply = setVector2; }
public static string Unregister(string key, ApplyFunc func) { _functionLibrary[key].Remove(func); return(key); }
public void Set(Matrix3 value) { valueObject.Matrix3 = value; Apply = setMatrix3; }
public void Set(float value) { valueObject.X = value; Apply = setFloat; }
public static string Register(string key, ApplyFunc func) { _functionLibrary[key].Add(func); return(key); }
public void Set(Vector4 value) { valueObject.Vector4 = value; Apply = setVector4; }
// Apply traverses a syntax tree recursively, starting with root, // and calling pre and post for each node as described below. // Apply returns the syntax tree, possibly modified. // // If pre is not nil, it is called for each node before the node's // children are traversed (pre-order). If pre returns false, no // children are traversed, and post is not called for that node. // // If post is not nil, and a prior call of pre didn't return false, // post is called for each node after its children are traversed // (post-order). If post returns false, traversal is terminated and // Apply returns immediately. // // Only fields that refer to AST nodes are considered children; // i.e., token.Pos, Scopes, Objects, and fields of basic types // (strings, etc.) are ignored. // // Children are traversed in the order in which they appear in the // respective node's struct definition. A package's files are // traversed in the filenames' alphabetical order. // public static ast.Node Apply(ast.Node root, ApplyFunc pre, ApplyFunc post) => func((defer, panic, _) =>
public void Apply_should_take_no_operand_operand_and_pass(int[] data, ApplyFunc apply) { apply(data); Assert.Pass(); }