예제 #1
0
 /// <summary>
 /// Constructs a new LUA stack object from the given state.
 /// </summary>
 /// <param name="state">A valid LUA state</param>
 public LuaStack(LuaState state)
 {
     if (state.Handle == IntPtr.Zero)
     { // Invalid state passed
         throw new ArgumentException("state must not be Zero", "state");
     }
     lua = state.Handle;
 }
예제 #2
0
 /// <summary>
 /// Conctructs a new LuaGC instance from the given state.
 /// </summary>
 /// <param name="state">A LUA state.</param>
 public LuaGC(LuaState state)
 {
     if (state == null)
     { // State must not be null
         throw new ArgumentNullException("state must not be null.", "state");
     }
     this.state = state;
 }
예제 #3
0
 /// <summary>
 /// Constructs a new table collection from the given state.
 /// </summary>
 /// <param name="state">State</param>
 public LuaTables(LuaState state)
 {
     if (state == null)
     { // state must not be null
         throw new ArgumentNullException("state");
     }
     this.state = state;
     // Special ones
     registry = new LuaTable(state, (int)SpecialTables.Registry);
     global = new LuaTable(state, (int)SpecialTables.Global);
 }
예제 #4
0
 /// <summary>
 /// Creates a new  LUA stack from the given state and automatically
 /// reserves space for a specified amount of items.
 /// </summary>
 /// <param name="state">A valid LUA state.</param>
 /// <param name="grow">Grows the stack.</param>
 public LuaStack(LuaState state, int grow)
     : this(state)
 {
     Grow(grow);
 }