Пример #1
0
        private static void ExpressionEvaluator_EvaluateVariable(object sender, VariableEvaluationEventArg e)
        {
            Creature    player      = GetPlayer(e.Evaluator.Variables);
            CastedSpell castedSpell = GetCastedSpell(e.Evaluator.Variables);
            DndVariable variable    = variables.FirstOrDefault(x => x.Handles(e.Name, player, castedSpell));

            if (variable != null)
            {
                e.Value = variable.GetValue(e.Name, e.Evaluator, player);
                Log($"  {e.Name} == {e.Value}");
            }
        }
Пример #2
0
 public static void AddVariable(DndVariable variable)
 {
     variables.Add(variable);
 }