Example #1
0
    public static int GetHeroComment(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 2)
            {
                CommentComponent commentComponent = (CommentComponent)LuaObject.checkSelf(l);
                int heroId;
                LuaObject.checkType(l, 2, out heroId);
                HeroComment heroComment = commentComponent.GetHeroComment(heroId);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, heroComment);
                result = 2;
            }
            else if (num == 4)
            {
                CommentComponent commentComponent2 = (CommentComponent)LuaObject.checkSelf(l);
                int heroId2;
                LuaObject.checkType(l, 2, out heroId2);
                HeroComment heroComment2;
                LuaObject.checkType <HeroComment>(l, 3, out heroComment2);
                PlayerHeroCommentEntry playerCommentEntry;
                LuaObject.checkType <PlayerHeroCommentEntry>(l, 4, out playerCommentEntry);
                int heroComment3 = commentComponent2.GetHeroComment(heroId2, heroComment2, playerCommentEntry);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, heroComment3);
                result = 2;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function GetHeroComment to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }