public Node(Linyee.LinyeeTypeValue i_val, TKey i_key) { this.values = new Node[] { this }; this.index = 0; this.i_val = i_val; this.i_key = i_key; }
public static int LinyeeORawEqualObj(Linyee.LinyeeTypeValue t1, Linyee.LinyeeTypeValue t2) { if (TType(t1) != TType(t2)) { return(0); } else { switch (TType(t1)) { case LINYEE_TNIL: return(1); case LINYEE_TNUMBER: return(luai_numeq(NValue(t1), NValue(t2)) ? 1 : 0); case LINYEE_TBOOLEAN: return(BValue(t1) == BValue(t2) ? 1 : 0); /* boolean true must be 1....but not in C# !! */ case LINYEE_TLIGHTUSERDATA: return(PValue(t1) == PValue(t2) ? 1 : 0); default: LinyeeAssert(IsCollectable(t1)); return(GCValue(t1) == GCValue(t2) ? 1 : 0); } } }
internal static void SetTTHValue(LinyeeState L, Linyee.LinyeeTypeValue obj, GCObject x) { obj.value.gc = x; obj.tt = LINYEE_TTHREAD; CheckLiveness(G(L), obj); }
public static bool IsLfunction(Linyee.LinyeeTypeValue o) { return((TType(o) == LINYEE_TFUNCTION) && (CLValue(o).c.isC == 0)); }
internal static TStringTSV TSValue(Linyee.LinyeeTypeValue o) { return(RawTSValue(o).tsv); }
///* to new object */ //#define setobj2n setobj internal static void SetObj2N(LinyeeState L, Linyee.LinyeeTypeValue obj, Linyee.LinyeeTypeValue x) { SetObj(L, obj, x); }
internal static void SetTType(Linyee.LinyeeTypeValue obj, int tt) { obj.tt = tt; }
internal static void SetPTValue(LinyeeState L, Linyee.LinyeeTypeValue obj, Proto x) { obj.value.gc = x; obj.tt = LUATPROTO; CheckLiveness(G(L), obj); }
//#define sethvalue2s sethvalue internal static void SetHValue2S(LinyeeState L, Linyee.LinyeeTypeValue obj, Table x) { SetHValue(L, obj, x); }
internal static LinyeeState THValue(Linyee.LinyeeTypeValue o) { return((LinyeeState)CheckExp(TTIsThread(o), o.value.gc.th)); }
public static int LIsFalse(Linyee.LinyeeTypeValue o) { return(((TTIsNil(o) || (TTIsBoolean(o) && BValue(o) == 0))) ? 1 : 0); }
internal static Table HValue(Linyee.LinyeeTypeValue o) { return(o.value.gc.h); }
internal static int BValue(Linyee.LinyeeTypeValue o) { return(o.value.b); }
internal static Closure CLValue(Linyee.LinyeeTypeValue o) { return(o.value.gc.cl); }
internal static UdataUV UValue(Linyee.LinyeeTypeValue o) { return(RawUValue(o).uv); }
internal static Udata RawUValue(Linyee.LinyeeTypeValue o) { return(o.value.gc.u); }
internal static void SetCLValue(LinyeeState L, Linyee.LinyeeTypeValue obj, Closure x) { obj.value.gc = x; obj.tt = LINYEE_TFUNCTION; CheckLiveness(G(L), obj); }
internal static void CheckConsistency(Linyee.LinyeeTypeValue obj) { LinyeeAssert(!IsCollectable(obj) || (TType(obj) == (obj).value.gc.gch.tt)); }
internal static void SetHValue(LinyeeState L, Linyee.LinyeeTypeValue obj, Table x) { obj.value.gc = x; obj.tt = LINYEE_TTABLE; CheckLiveness(G(L), obj); }
internal static void CheckLiveness(GlobalState g, Linyee.LinyeeTypeValue obj) { LinyeeAssert(!IsCollectable(obj) || ((TType(obj) == obj.value.gc.gch.tt) && !IsDead(g, obj.value.gc))); }
internal static void SetObj(LinyeeState L, Linyee.LinyeeTypeValue obj1, Linyee.LinyeeTypeValue obj2) { obj1.value.Copy(obj2.value); obj1.tt = obj2.tt; CheckLiveness(G(L), obj1); }
/* Macros to set values */ internal static void SetNilValue(Linyee.LinyeeTypeValue obj) { obj.tt = LINYEE_TNIL; }
//#define setptvalue2s setptvalue internal static void SetPTValue2S(LinyeeState L, Linyee.LinyeeTypeValue obj, Proto x) { SetPTValue(L, obj, x); }
internal static void SetNValue(Linyee.LinyeeTypeValue obj, LinyeeNumberType x) { obj.value.n = x; obj.tt = LINYEE_TNUMBER; }
//#define setsvalue2n setsvalue internal static void SetSValue2N(LinyeeState L, Linyee.LinyeeTypeValue obj, TString x) { SetSValue(L, obj, x); }
internal static LinyeeNumberType NValue(Linyee.LinyeeTypeValue o) { return(o.value.n); }
internal static bool IsCollectable(Linyee.LinyeeTypeValue o) { return(TType(o) >= LINYEE_TSTRING); }
internal static void SetBValue(Linyee.LinyeeTypeValue obj, int x) { obj.value.b = x; obj.tt = LINYEE_TBOOLEAN; }
internal static void SetPValue(Linyee.LinyeeTypeValue obj, object x) { obj.value.p = x; obj.tt = LINYEE_TLIGHTUSERDATA; }
internal static TString RawTSValue(Linyee.LinyeeTypeValue o) { return(o.value.gc.ts); }