public CardCollect Run(CardCollect cc) { CozyLuaCore lua = new CozyLuaCore(); lua.LoadCLRPackage(); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')"); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Util')"); lua.DoFile(PathTransform.LuaScript(script_)); var f = lua.GetFunction("deal"); return (CardCollect)f.Call(cc).First(); }
public void Run(CardCollect cc) { CozyLuaCore lua = new CozyLuaCore(); lua.LoadCLRPackage(); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')"); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Util')"); lua.DoFile(PathTransform.LuaScript(script_)); var f = lua.GetFunction("shuffle"); f.Call(cc); }
virtual public bool Init(string script) { CozyLuaCore lua = new CozyLuaCore(); lua.DoFile(PathTransform.LuaScript(script)); mapMethod = new Dictionary<string, string>(); var methods = lua.GetTable("methods"); var em = methods.GetEnumerator(); while (em.MoveNext()) { mapMethod.Add((string)em.Key, (string)em.Value); } return true; }
public CardCollect Run() { CozyLuaCore lua = new CozyLuaCore(); lua.LoadCLRPackage(); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')"); lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Util')"); lua.DoFile(PathTransform.LuaScript(script_)); //lua.DoString(@" import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')"); //lua.DoString(@" // cc = CardCollect() // c = Card(1,1) // cc:Add(c)"); return (CardCollect)lua["cc"]; }