public unsafe void SetDouble(int index, double Value) { if (index > 0 && index <= sizearray) { index = index - 1; LuaTValue *v = (LuaTValue *)(array) + index; v->n = Value; v->tt_ = LuaEnvValues.LUA_TNUMFLT; } }
public unsafe void SetInt(int index, int Value) { if (index > 0 && index <= sizearray) { index = index - 1; LuaTValue *v = (LuaTValue *)(array) + index; v->i = Value; v->tt_ = LuaEnvValues.LUA_TNUMINT; } }
public unsafe double GetDouble(int index) { if (index > 0 && index <= sizearray) { index = index - 1; LuaTValue *tv = (LuaTValue *)(array) + index; if (tv->tt_ == LuaEnvValues.LUA_TNUMINT) { return((double)tv->i); } else { return(tv->n); } } else { return(0); } }