本文整理汇总了C#中Operation.executeList方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.executeList方法的具体用法?C# Operation.executeList怎么用?C# Operation.executeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation.executeList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: mainGameThread
void mainGameThread()
{
IList rulesAndEffects=_GameData[_effects] as IList;
Conditional stack=new Conditional();
stack[_Game]=_GameData;
List<Conditional> wrappedEffects=wrapGameEffects();
stack[_effects]=wrappedEffects;
stack[_target]=null;
stack[_rootl]=_GameData;
string curName="";
Debug.Log(string.Format("effects : {0}",wrappedEffects.Count));
try
{
while(runThread)
{
int ii=0;
while(ii<rulesAndEffects.Count)
{
object obj =rulesAndEffects[ii];
ii++;
Conditional eff=obj as Conditional;
curName=eff["__name"] as string;
if(!eff.hasTag(EXECUTE_PREFIX)&&!eff.hasTag(EXECUTE_POSTFIX))
{
Condition cnd=eff[_condition] as Condition;
//Debug.Log(cnd);
//Monitor.Enter(gameLock);
if(cnd.isFulfilled(stack,stack[_Game] as Conditional))
{
//Debug.Log(cnd);
lock(gameLock)
{
Operation op=new Operation(Operation.Commands.NEW);
Conditional nstack=op.createStack(stack, eff);
int oneff=rulesAndEffects.Count;
op.executeList(eff[_commands], nstack);
if(rulesAndEffects.Count!=oneff)
{
stack[_effects]=wrapGameEffects();
Debug.Log("added trules");
}
if(nstack.hasTag(TAG_ABORT))
{
Debug.Log("GameObject Overlapped");
return;//gameover? I guess
}
}
}
//Monitor.Exit(gameLock);
}
}
}
}
catch (System.Exception ex)
{
Debug.Log(ex);
Debug.Log(curName);
// I WILL LOG THE EXCEPTION object "EX" here ! but ex.StackTrace is truncated!
}
}
示例2: foreach
public object this [string name] { //let us add the dot notation...
get {
string [] ln=name.Split('.');
if(ln.Length==1)
{
object ret=null;
if(ln[0]==_conditional_self)
return this;
if(_values.TryGetValue(ln[0], out ret))
{
IList ab=accessBindings(name);
double dret=0;
if(ab!=null&&ab.Count>0&&tryGetDouble(ret,out dret))
{
bool changed=false;
foreach(object o in ab)
{
Conditional accessBound=o as Conditional;
if(accessBound==null)
{
#if THING
Debug.Log(string.Format("Invalid access bound list element {0}",o));
#endif
return ret;
}
if(accessBound.hasTag("IN_BINDING")) continue;
Condition cnd=accessBound[_condition] as Condition;
if(cnd==null)
{
#if THING
Debug.Log(string.Format("No condition ffound in access bound element {0}",accessBound));
#endif
continue;
}
accessBound.setTag("IN_BINDING");
if(cnd.isFulfilled(this,this[_upcond] as Conditional))
{
Conditional nstack=new Conditional(false);
nstack[_parentl]=this;
nstack[_upcond]=this;
nstack[_effects]=new List<Conditional>();
nstack[_rootl]=_values[_rootl];
nstack["_bound"]=dret;
Operation e=new Operation(Operation.Commands.NEW);
e.executeList(accessBound[_commands],nstack);
dret=(double)nstack["_bound"];
//Debug.Log("bound");
changed=true;
}
accessBound.removeTag("IN_BINDING");
}
if(changed) return dret;
}
return ret;
}
else
return null;
} else
{
object ret=null;
if(_values.TryGetValue(ln[0], out ret))
{
Conditional nxt=ret as Conditional;
if(nxt!=null)
return nxt[name.Substring(ln[0].Length+1)];//hopefully...
else
{
Debug.Log(string.Format("invalid name chain: {0}",name));
return null;
}
} else
return null;
}
}
set {
string [] ln=name.Split('.');
if(ln.Length==1)
{
_values[name]=value;
} else
{
object ret=null;
if(_values.TryGetValue(ln[0], out ret))
{
Conditional nxt=ret as Conditional;
nxt[name.Substring(ln[0].Length+1)]=value;//hopefully...
}
}
}
}