本文整理汇总了C#中Transition.populate方法的典型用法代码示例。如果您正苦于以下问题:C# Transition.populate方法的具体用法?C# Transition.populate怎么用?C# Transition.populate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transition
的用法示例。
在下文中一共展示了Transition.populate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isAGoalState
/// <summary>
/// Returns true if the current State is a Goal State.
/// </summary>
public override bool isAGoalState (ref DefaultState currentStates, ref DefaultState idealGoalState)
{
bool finished = true;
List<Transition> endTransitions = manager.endTransitions;
foreach (Transition trans in endTransitions)
{
Transition tran = new Transition(trans.eventSig, trans.parameterIDs);
finished = tran.populate(currentStates.worldstate);
if(!finished)
return false;
}
long cS, gS, cSR, gSR;
int nrRelevantPrototypes = relevanceMasks.Length;
for(int i = 0; i<nrRelevantPrototypes;i++)
{
if (relevanceMasks[i].stateRelevant)
{
cS = (currentStates.worldstate.GetPrototypeById(relevanceMasks[i].id)).State.GetStateBits() & relevanceMasks[i].stateMask;
gS = (idealGoalState.worldstate.GetPrototypeById(relevanceMasks[i].id)).State.GetStateBits() & relevanceMasks[i].stateMask;
finished = finished && (countSetBits(cS ^ gS)==0);
if(!finished)
return false;
}
if(relevanceMasks[i].relationsRelevant)
{
for(uint j=0; j<noStatesInGS; j++)
{
cSR = currentStates.worldstate.GetPrototypeById(relevanceMasks[i].id).State.GetRelationBits(j) & relevanceMasks[i].GetRelationBits(j);
gSR = idealGoalState.worldstate.GetPrototypeById(relevanceMasks[i].id).State.GetRelationBits(j)& relevanceMasks[i].GetRelationBits(j);
finished = finished && (countSetBits(cSR ^ gSR)==0);
if(!finished)
return false;
}
}
}
return finished;
}
示例2: SimulateUpTo
/// <summary>
/// Simulate the state of the StateSpaceManager up to a certain Beat (specified by level)
/// </summary>
public void SimulateUpTo(StateSpaceManager stateSpaceManager, int startLevel, StoryArc story)
{
stateSpaceManager.resetGlobalState ();
for(int i=0; i< startLevel; i++)
{
foreach(StoryEvent ev in story.Beats[i].Events)
{
Rules.ClearCache();
Transition implicitPopulated = new Transition(ev);
implicitPopulated.populate(stateSpaceManager.globalState.worldstate);
stateSpaceManager.changeStateToPostconditionsOf(implicitPopulated);
}
}
}