GetValue() private method

private GetValue ( object key ) : object
key object
return object
Exemplo n.º 1
0
        public static Varargs IPairs(LuaTable t)
        {
            var length = t.Length();
            Func<double, object> func =
                index =>
                    {
                        index++;
                        return index > length ? null : new Varargs(index, t.GetValue(index));
                    };

            return new Varargs(func, t, 0.0);
        }
Exemplo n.º 2
0
        public Varargs Unpack(LuaTable list, object i = null, object j = null)
        {
            var listLength = list.Length();

            var startIndex = ConvertToNumber(i, 2, 1.0);
            var length = ConvertToNumber(j, 3, listLength);

            if (startIndex < 1)
                return Varargs.Empty;
            length = Math.Min(length, listLength - startIndex + 1);

            var array = new object[(int)length];
            var arrayIndex = 0;
            for (var k = startIndex; k < startIndex + length; k++)
                array[arrayIndex++] = list.GetValue(k);

            return new Varargs(array);
        }
Exemplo n.º 3
0
 public object RawGet(LuaTable table, object index)
 {
     return table.GetValue(index);
 }
Exemplo n.º 4
0
 private string MethodTableToString(LuaTable table)
 {
     return string.Format("{0}.{1}(...)", (table.GetValue("__clrtype") as Type).FullName, table.GetValue("__method"));
 }