Beispiel #1
0
        public AttActionCtrl(AttRuleCtrl ctrl, SkEntity skEntity, string para)
        {
            mActions = new List <AttAction>();
            string[] condStrs = para.Split(';');
            foreach (string condStr in condStrs)
            {
                string[] paraStr = condStr.Split(',');
                switch (paraStr[0].ToLower())
                {
                case "skill":
                    AttAction_Skill actSkill = new AttAction_Skill(skEntity, paraStr);
                    mActions.Add(actSkill);
                    break;

                case "camp":
                    AttAction_Att actAtt = new AttAction_Att(skEntity, paraStr);
                    mActions.Add(actAtt);
                    break;

                case "func":
                    AttAction_Func actFunc = new AttAction_Func(skEntity, paraStr);
                    mActions.Add(actFunc);
                    break;

                case "Action":
                    AttAction_Action actAct = new AttAction_Action(skEntity, paraStr, ctrl);
                    mActions.Add(actAct);
                    break;
                }
            }
        }
Beispiel #2
0
        public static AttRule Creat(AttRuleCtrl ctrl, SkEntity skEntity, int ruleID)
        {
            AttRuleData data = AttRuleData.GetRuleData(ruleID);

            if (null != data)
            {
                AttRule rule = new AttRule();
                rule.mFilter = new AttFilterCtrl(skEntity, data.mFilter, rule.CheckAction);
                rule.mCond   = new AttCondCtrl(skEntity, data.mCond);
                rule.mAction = new AttActionCtrl(ctrl, skEntity, data.mAction);
                return(rule);
            }
            return(null);
        }
Beispiel #3
0
 public AttAction_Action(SkEntity skEntity, string[] para, AttRuleCtrl ruleCtrl) : base(skEntity)
 {
     mIsAdd    = para[1].ToLower() == "add";
     mRuleID   = Convert.ToInt32(para[2]);
     mRuleCtrl = ruleCtrl;
 }