本文整理汇总了C#中GlobalState类的典型用法代码示例。如果您正苦于以下问题:C# GlobalState类的具体用法?C# GlobalState怎么用?C# GlobalState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GlobalState类属于命名空间,在下文中一共展示了GlobalState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: check
public static int check(GlobalState globalstate)
{
if (check (globalstate as Conditions))
return GlobalStateCondition.GS_SATISFIED;
else
return GlobalStateCondition.GS_NOT_SATISFIED;
}
示例2:
public GlobalState this[GlobalState.StateType i]
{
get
{
return fStates[(int)i];
}
set
{
fStates[(int)i] = value;
}
}
示例3: ChangeOperationType
public void ChangeOperationType(GlobalState state)
{
switch (state)
{
case GlobalState.DRAG_WHITEBALL:
SetOpeartion(dragOperation);
break;
case GlobalState.IDLE:
SetOpeartion(pointerOperation);
break;
default:
SetOpeartion(m_DontDoAnyOperation);
break;
}
}
示例4: PropagateAll
private static uint PropagateAll(GlobalState g)
{
uint m = 0;
while (g.gray != null) m += (uint)PropagateMark(g);
return m;
}
示例5: MarkTMU
private static void MarkTMU(GlobalState g)
{
GCObject u = g.tmudata;
if (u != null) {
do {
u = u.gch.next;
MakeWhite(g, u); /* may be marked, if left from previous GC */
ReallyMarkObject(g, u);
} while (u != g.tmudata);
}
}
示例6: RootGCRef
public RootGCRef(GlobalState g)
{
this.g = g;
}
示例7: CheckLiveness
internal static void CheckLiveness(GlobalState g, TValue obj)
{
LuaAssert(!IsCollectable(obj) ||
((TType(obj) == obj.value.gc.gch.tt) && !IsDead(g, obj.value.gc)));
}
示例8: TraverseTable
private static int TraverseTable(GlobalState g, Table h)
{
int i;
int weakkey = 0;
int weakvalue = 0;
/*const*/ TValue mode;
if (h.metatable != null)
MarkObject(g, h.metatable);
mode = gfasttm(g, h.metatable, TMS.TM_MODE);
if ((mode != null) && TTIsString(mode)) { /* is there a weak mode? */
weakkey = (strchr(SValue(mode), 'k') != null) ? 1 : 0 ;
weakvalue = (strchr(SValue(mode), 'v') != null) ? 1 : 0;
if ((weakkey!=0) || (weakvalue!=0)) { /* is really weak? */
h.marked &= (byte)~(KEYWEAK | VALUEWEAK); /* clear bits */
h.marked |= CastByte((weakkey << KEYWEAKBIT) |
(weakvalue << VALUEWEAKBIT));
h.gclist = g.weak; /* must be cleared after GC, ... */
g.weak = obj2gco(h); /* ... so put in the appropriate list */
}
}
if ((weakkey!=0) && (weakvalue!=0)) return 1;
if (weakvalue==0) {
i = h.sizearray;
while ((i--) != 0)
MarkValue(g, h.array[i]);
}
i = SizeNode(h);
while ((i--) != 0) {
Node n = gnode(h, i);
LuaAssert(TType(gkey(n)) != LUATDEADKEY || TTIsNil(gval(n)));
if (TTIsNil(gval(n)))
RemoveEntry(n); /* remove empty entries */
else {
LuaAssert(!TTIsNil(gkey(n)));
if (weakkey==0) MarkValue(g, gkey(n));
if (weakvalue==0) MarkValue(g, gval(n));
}
}
return ((weakkey != 0) || (weakvalue != 0)) ? 1 : 0;
}
示例9: TraverseProto
/*
** All marks are conditional because a GC may happen while the
** prototype is still being created
*/
private static void TraverseProto(GlobalState g, Proto f)
{
int i;
if (f.source != null) StringMark(f.source);
for (i=0; i<f.sizek; i++) /* mark literals */
MarkValue(g, f.k[i]);
for (i=0; i<f.sizeupvalues; i++) { /* mark upvalue names */
if (f.upvalues[i] != null)
StringMark(f.upvalues[i]);
}
for (i=0; i<f.sizep; i++) { /* mark nested protos */
if (f.p[i] != null)
MarkObject(g, f.p[i]);
}
for (i=0; i<f.sizelocvars; i++) { /* mark local-variable names */
if (f.locvars[i].varname != null)
StringMark(f.locvars[i].varname);
}
}
示例10: RemarkUpVals
private static void RemarkUpVals(GlobalState g)
{
UpVal uv;
for (uv = g.uvhead.u.l.next; uv != g.uvhead; uv = uv.u.l.next) {
LuaAssert(uv.u.l.next.u.l.prev == uv && uv.u.l.prev.u.l.next == uv);
if (IsGray(obj2gco(uv)))
MarkValue(g, uv.v);
}
}
示例11: MakeWhite
public static void MakeWhite(GlobalState g, GCObject x)
{
x.gch.marked = (byte)(x.gch.marked & maskmarks | LuaCWhite(g));
}
示例12: LuaCWhite
public static byte LuaCWhite(GlobalState g)
{
return (byte)(g.currentwhite & WHITEBITS);
}
示例13: IsDead
public static bool IsDead(GlobalState g, GCObject v)
{
return (v.gch.marked & OtherWhite(g) & WHITEBITS) != 0;
}
示例14: gfasttm
public static TValue gfasttm(GlobalState g, Table et, TMS e)
{
return (et == null) ? null :
((et.flags & (1 << (int)e)) != 0) ? null :
luaT_gettm(et, e, g.tmname[(int)e]);
}
示例15: addGlobalState
/**
* Adds a global state to the list of global states in the game
*
* @param globalState
* the global state to add
*/
public void addGlobalState(GlobalState globalState)
{
globalStates.Add(globalState);
}