Beispiel #1
0
        public virtual bool Meet(IEventArgs args)
        {
            if (value.IsNull())
            {
                if (con.Equals("=="))
                {
                    return(!para.IsNotNull(args));
                }
                else
                {
                    if (con.Equals("<>"))
                    {
                        return(para.IsNotNull(args));
                    }
                }
            }
            IPara source = para.GetSourcePara(args);

            if (source != null)
            {
                IPara target = value.GetTargetPara(args, source);
                try
                {
                    bool r = source.Meet(con, target);
                    target.Recycle();
                    return(r);
                }
                catch (Exception e)
                {
                    throw new GameConfigExpception(para.ToString() + con + value.ToString() + " is not valid.\n" + ExceptionUtil.GetExceptionContent(e));
                }
            }
            return(false);
        }
Beispiel #2
0
        public virtual void Op(IEventArgs args)
        {
            IPara s   = source.GetSourcePara(args);
            IPara tt1 = t1.GetTargetPara(args, s);

            if (t2 == null)
            {
                s.SetValue("=", tt1);
            }
            else
            {
                IPara tt2  = t2.GetTargetPara(args, s);
                IPara temp = (IPara)s.Borrow();
                temp.SetValue("=", tt1);
                temp.SetValue(op, tt2);
                s.SetValue("=", temp);
                temp.Recycle();
                tt2.Recycle();
            }
            tt1.Recycle();
        }