public void Execute(ref WooState state) { double rand = state._Random.NextDouble(); double totalWeight = 0; foreach (Expression e in _Weight) { totalWeight += e.EvaluateFloat(ref state); } rand *= totalWeight; double currentWeight = 0; int i = 0; while (currentWeight < rand) { currentWeight += _Weight[i++].EvaluateFloat(ref state); } if (state._Recursions > 0 || !state.GetRule(_Rule[i - 1]).CanRecurse()) { state._Recursions--; WooState newState = state.Clone(); state.GetRule(_Rule[i - 1]).Execute(ref newState); state._Recursions++; } }
public void Execute(ref WooState state) { if (state._Recursions == 0) { state._Recursions--; WooState newState = state.Clone(); state.GetRule(_Callee).Execute(ref newState); state._Recursions++; } }
public void Execute(ref WooState state) { if (state._Recursions == 0) { state._Recursions--; WooState newState = state.Clone(); state.GetRule(_Callee).Execute(ref newState); state._Recursions++; } }
public void Execute(ref WooState state) { double rand = state._Random.NextDouble(); double totalWeight = 0; foreach (Expression e in _Weight) totalWeight += e.EvaluateFloat(ref state); rand *= totalWeight; double currentWeight = 0; int i = 0; while (currentWeight < rand) { currentWeight += _Weight[i++].EvaluateFloat(ref state); } if (state._Recursions > 0 || !state.GetRule(_Rule[i - 1]).CanRecurse()) { state._Recursions--; WooState newState = state.Clone(); state.GetRule(_Rule[i - 1]).Execute(ref newState); state._Recursions++; } }
public void Execute(ref WooState state) { WooState newState = state.Clone(); _RuleBlock.Execute(ref newState); }
public void Execute(ref WooState state) { WooState newState = state.Clone(); _RuleBlock.Execute(ref newState); }
public void Execute(ref WooState state) { state._PreviousState = state.Clone(); }
public void Execute(ref WooState state) { state._PreviousState = state.Clone(); }