public static Expression Parse(ConfigNode configNode, DataNode dataNode, ExpressionFactory factory)
        {
            Expression e = new Expression(dataNode);
            e.factory = factory;
            e.Load(configNode);
            e.factory = null;

            return e;
        }
 /// <summary>
 /// Copy constructor. 
 /// </summary>
 /// <param name="source"></param>
 public Expression(Expression source)
 {
     dataNode = source.dataNode;
     onOfferExpr = new List<ExpVal>(source.onOfferExpr);
     onAcceptExpr = new List<ExpVal>(source.onAcceptExpr);
     onSuccessExpr = new List<ExpVal>(source.onSuccessExpr);
     onFailExpr = new List<ExpVal>(source.onFailExpr);
     onParameterComplete = new Dictionary<string, List<ExpVal>>(source.onParameterComplete);
     SetupMap();
 }
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            // Call Expression for load behaviour
            try
            {
                expression = Expression.Parse(configNode, dataNode, this);
            }
            catch (Exception e)
            {
                valid = false;
                LoggingUtil.LogError(this, ErrorPrefix(configNode) + ": Couldn't load expression.");
                LoggingUtil.LogException(e);
            }

            return valid && expression != null;
        }