Пример #1
0
 public void OnTextEntered(MoonSharp.Interpreter.Closure handler)
 {
     TextEntered += (s) =>
     {
         handler.Call(s);
     };
 }
Пример #2
0
 public void OnUpdate(MoonSharp.Interpreter.Closure handler)
 {
     callback += (x) =>
     {
         handler.Call(x);
     };
 }
Пример #3
0
            public List <Music> Query(Playlist play, MoonSharp.Interpreter.Closure func)
            {
                var temp = new List <Music>();

                foreach (Music m in play.music)
                {
                    var tags     = getTag(m);
                    var filename = m.Filename;
                    try {
                        var truth = func.Call(filename, tags).CastToBool();
                        if (truth)
                        {
                            temp.Add(m);
                        }
                    } catch (Exception e)
                    {
                        //eventually print to internal console
                    }
                }

                return(temp);
            }