コード例 #1
0
ファイル: FreeLog.cs プロジェクト: yangfan111/CsharpCode
        private static string ToTrigger()
        {
            if (trigger is GameTrigger)
            {
                GameTrigger gt = (GameTrigger)trigger;
                return(string.Format("触发器:{0} 触发类型:{1} 分类:{2} 规则:{3}", gt.GetName(), gt.GetKey(), gt.GetGroup(), gt.GetRule()));
            }
            else if (trigger is string)
            {
                return((string)trigger);
            }
            else if (trigger is FreeEntityData)
            {
                FreeEntityData move = (FreeEntityData)trigger;
                return(string.Format("FreeMove:{0}", move.name));
            }
            else if (trigger is ISkill)
            {
                ISkill skill = (ISkill)trigger;
                string key   = skill.GetKey() != null?skill.GetKey() : string.Empty;

                if (skill is AbstractCoolDownSkill)
                {
                    PlayerActionSkill cooldown     = (PlayerActionSkill)skill;
                    string            skillTrigger = cooldown.trigger != null?cooldown.trigger.ToString() : string.Empty;

                    return(string.Format("动作技能:{0}, 触发:{1}", cooldown.GetKey(), skillTrigger));
                }
                else
                {
                    return(string.Format("技能:{0}", skill.GetKey()));
                }
            }
            else if (trigger is FreeBuf)
            {
                FreeBuf buf = (FreeBuf)trigger;
                return(string.Format("Buf:{0}", buf.GetKey()));
            }

            return(string.Empty);
        }
コード例 #2
0
        protected void RecordResult(IEventArgs args, GameTrigger trigger, TestValue[] tvs)
        {
            CaseKey key = new CaseKey();

            if (trigger != null)
            {
                key.rule = trigger.GetRule();
                key.suit = trigger.GetGroup() + "|" + trigger.GetName();
            }
            else
            {
                key.rule = Unknown;
                key.suit = Unknown;
            }

            key.caseName = name;
            key.field    = tvs[0].Name;

            if (args.FreeContext.TestCase.data != null)
            {
                args.FreeContext.TestCase.data.RecordResult(key, tvs);
            }
        }