public void Execute(EventResults result, Game game, EventContext context) { if (XmlHelper.IsSpecialName(varName)) throw new InvalidOperationException("Cannot assign to special properties: " + varName); context.SetVariable(context.CurrentCharacter, varName, newValue.Calculate(context, game)); }
public double Evaluate(Game game, EventContext context, Weights weights) { if (XmlHelper.IsSpecialName(varName)) throw new InvalidOperationException("Cannot assign to special properties: " + varName); context.SetVariable(context.CurrentCharacter, varName, newValue.Calculate(context, game)); return 0.0; }