示例#1
0
 public void Set(Texture2DI resource)
 {
     var texture = (Texture2D)resource;
     video.currentPixelTextures[index] = texture;
     this.texture = new WeakReference(texture);
     Apply = setTexture2D;
 }
示例#2
0
 public void Set(float[] values)
 {
     valueArrayOffset        = 0;
     valueArrayCount         = values.Length;
     valueArrayObject.Target = values;
     Apply = setFloatArray;
 }
示例#3
0
 public void Set(Vector4[] values, int offset, int count)
 {
     valueArrayOffset        = offset;
     valueArrayCount         = count;
     valueArrayObject.Target = values;
     Apply = setVector4Array;
 }
示例#4
0
 public void Set(Vector4[] values)
 {
     valueArrayOffset        = 0;
     valueArrayCount         = values.Length;
     valueArrayObject.Target = values;
     Apply = setVector4Array;
 }
示例#5
0
 public void Set(float[] values, int offset, int count)
 {
     valueArrayOffset        = offset;
     valueArrayCount         = count;
     valueArrayObject.Target = values;
     Apply = setFloatArray;
 }
示例#6
0
 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;
 }
示例#7
0
 public void Set(float x, float y, float z)
 {
     valueObject.X = x;
     valueObject.Y = y;
     valueObject.Z = z;
     Apply         = setVector3;
 }
示例#8
0
 public void Set(Matrix4[] values, int count)
 {
     valueArrayOffset        = 0;
     valueArrayCount         = count;
     valueArrayObject.Target = values;
     Apply = setMatrix4Array;
 }
示例#9
0
        public ShaderVariable(int location, string name)
        {
            this.location = location;
            this.Name     = name;

            Apply            = setNothing;
            valueArrayObject = new WeakReference(null);
        }
示例#10
0
        public ShaderResource(VideoI video, int index, string name)
        {
            this.video = (Video)video;
            this.index = index;
            this.Name = name;

            Apply = setNothing;
        }
示例#11
0
        public ShaderVariable(int location, string name)
        {
            this.location = location;
            this.Name = name;

            Apply = setNothing;
            valueArrayObject = new WeakReference(null);
        }
示例#12
0
        public void Set(Texture2DI resource)
        {
            var texture = (Texture2D)resource;

            video.currentPixelTextures[index] = texture;
            this.texture = new WeakReference(texture);
            Apply        = setTexture2D;
        }
示例#13
0
        public ShaderResource(VideoI video, int index, string name)
        {
            this.video = (Video)video;
            this.index = index;
            this.Name  = name;

            Apply = setNothing;
        }
示例#14
0
        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);
        }
示例#15
0
 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();
     }
 }
示例#17
0
 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;
 }
示例#18
0
 public void Set(ITexture2D resource)
 {
     var texture = (Texture2D)resource;
     video.currentTextures[index] = texture;
     resourceIndex = texture.Texture;
     this.texture = new WeakReference(texture);
     Apply = setTexture2D;
 }
示例#19
0
        public ShaderVariable(ShaderProgram program, int index, string name)
        {
            this.program = program;
            this.index   = index;
            this.Name    = name;

            Apply            = setNothing;
            valueArrayObject = new WeakReference(null);
        }
示例#20
0
        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;
        }
示例#21
0
        public void Set(ITexture2D resource)
        {
            var texture = (Texture2D)resource;

            video.currentTextures[index] = texture;
            resourceIndex = texture.Texture;
            this.texture  = new WeakReference(texture);
            Apply         = setTexture2D;
        }
示例#22
0
        public ShaderVariable(ShaderProgram program, int index, string name)
        {
            this.program = program;
            this.index = index;
            this.Name = name;

            Apply = setNothing;
            valueArrayObject = new WeakReference(null);
        }
示例#23
0
        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;
        }
示例#24
0
        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 } }
                      );;
        }
示例#25
0
 public void Set(float[] values, int offset, int count)
 {
     valueArrayOffset = offset;
     valueArrayCount = count;
     valueArrayObject.Target = values;
     Apply = setFloatArray;
 }
示例#26
0
 public void Set(Vector4[] values, int offset, int count)
 {
     valueArrayOffset = offset;
     valueArrayCount = count;
     valueArrayObject.Target = values;
     Apply = setVector4Array;
 }
示例#27
0
 public void Set(Vector4[] values)
 {
     valueArrayOffset = 0;
     valueArrayCount = values.Length;
     valueArrayObject.Target = values;
     Apply = setVector4Array;
 }
示例#28
0
 public void Set(Matrix4[] values, int count)
 {
     valueArrayOffset = 0;
     valueArrayCount = count;
     valueArrayObject.Target = values;
     Apply = setMatrix4Array;
 }
示例#29
0
 public void Set(Matrix4 value)
 {
     valueObject.Matrix4 = value;
     Apply = setMatrix4;
 }
示例#30
0
 public void Set(float[] values)
 {
     valueArrayOffset = 0;
     valueArrayCount = values.Length;
     valueArrayObject.Target = values;
     Apply = setFloatArray;
 }
示例#31
0
 public void Set(Matrix2 value)
 {
     valueObject.Matrix2 = value;
     Apply = setMatrix2;
 }
示例#32
0
 public void Set(Vector3 value)
 {
     valueObject.Vector3 = value;
     Apply = setVector3;
 }
示例#33
0
 public void Set(Vector3 value)
 {
     valueObject.Vector3 = value;
     Apply = setVector3;
 }
示例#34
0
 public void Set(float x, float y)
 {
     valueObject.X = x;
     valueObject.Y = y;
     Apply = setVector2;
 }
示例#35
0
 public void Set(Vector2 value)
 {
     valueObject.Vector2 = value;
     Apply = setVector2;
 }
示例#36
0
 public void Set(Matrix4 value)
 {
     valueObject.Matrix4 = value;
     Apply = setMatrix4;
 }
示例#37
0
 public static string Unregister(string key, ApplyFunc func)
 {
     _functionLibrary[key].Remove(func);
     return(key);
 }
示例#38
0
 public void Set(Matrix3 value)
 {
     valueObject.Matrix3 = value;
     Apply = setMatrix3;
 }
示例#39
0
 public void Set(float value)
 {
     valueObject.X = value;
     Apply         = setFloat;
 }
示例#40
0
 public void Set(float value)
 {
     valueObject.X = value;
     Apply = setFloat;
 }
示例#41
0
 public static string Register(string key, ApplyFunc func)
 {
     _functionLibrary[key].Add(func);
     return(key);
 }
示例#42
0
 public void Set(Matrix2 value)
 {
     valueObject.Matrix2 = value;
     Apply = setMatrix2;
 }
示例#43
0
 public void Set(Vector4 value)
 {
     valueObject.Vector4 = value;
     Apply = setVector4;
 }
示例#44
0
 public void Set(Vector2 value)
 {
     valueObject.Vector2 = value;
     Apply = setVector2;
 }
示例#45
0
文件: rewrite.cs 项目: zjmit/go2cs
 // 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, _) =>
示例#46
0
 public void Set(Vector4 value)
 {
     valueObject.Vector4 = value;
     Apply = setVector4;
 }
示例#47
0
 public void Set(Matrix3 value)
 {
     valueObject.Matrix3 = value;
     Apply = setMatrix3;
 }
 public void Apply_should_take_no_operand_operand_and_pass(int[] data, ApplyFunc apply)
 {
     apply(data);
     Assert.Pass();
 }
示例#49
0
 public void Set(float x, float y)
 {
     valueObject.X = x;
     valueObject.Y = y;
     Apply         = setVector2;
 }
示例#50
-1
 public void Set(float x, float y, float z)
 {
     valueObject.X = x;
     valueObject.Y = y;
     valueObject.Z = z;
     Apply = setVector3;
 }