public void TestFunctions10() { using (Lua l = new Lua()) { l.PrintExpressionTree = Console.Out; var g = l.CreateEnvironment(); var p = new TestParam(); g.DoChunk("p.Test = 3;", "dummy", new KeyValuePair <string, object>("p", p)); Assert.AreEqual(3, p.Test); } }
public void TestFunctions02() { TestParam p = new TestParam(); int i = 0; Func <TestParam, int> f1 = (p_) => { i++; return(p.Value + p_.Value); }; Func <int> f2 = p.GetValue; Func <int> f3 = () => 1; PrintDelegate(f1); PrintDelegate(f2); PrintDelegate(f3); PrintDelegate(new ParamOutDelegate(p.ParamOut)); Console.WriteLine(i); }
public void TestFunctions02() { TestParam p = new TestParam(); int i = 0; Func<TestParam, int> f1 = (p_) => { i++; return p.Value + p_.Value; }; Func<int> f2 = p.GetValue; Func<int> f3 = () => 1; PrintDelegate(f1); PrintDelegate(f2); PrintDelegate(f3); PrintDelegate(new ParamOutDelegate(p.ParamOut)); Console.WriteLine(i); }
public void TestFunctions10() { using (Lua l = new Lua()) { l.PrintExpressionTree = Console.Out; var g = l.CreateEnvironment(); var p = new TestParam(); g.DoChunk("p.Test = 3;", "dummy", new KeyValuePair<string, object>("p", p)); Assert.AreEqual(3, p.Test); } }