Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 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;
     }
 }
Beispiel #3
0
 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);
     }
 }