예제 #1
0
 protected override void ReadAttributes(XmlElement e)
 {
     KeyType   = e.GetAttributeValueAsEnum("KeyType", Skill.Framework.AI.AccessKeyType.CounterLimit);
     AccessKey = e.GetAttributeValueAsString("AccessKey", "");
     ClassName = e.GetAttributeValueAsString("ClassName", "");
     base.ReadAttributes(e);
 }
예제 #2
0
        private static AccessKeyData CreateAccessKeyFrom(XmlElement node)
        {
            AccessKeyData result = null;

            Skill.Framework.AI.AccessKeyType accessKeyType = Skill.Framework.AI.AccessKeyType.TimeLimit;
            bool isCorrect = false;

            try
            {
                accessKeyType = (Skill.Framework.AI.AccessKeyType)Enum.Parse(typeof(Skill.Framework.AI.AccessKeyType), node.Name.ToString(), false);
                isCorrect     = true;
            }
            catch (Exception)
            {
                isCorrect = false;
            }
            if (isCorrect)
            {
                switch (accessKeyType)
                {
                case Skill.Framework.AI.AccessKeyType.CounterLimit:
                    result = new CounterLimitAccessKeyData();
                    break;

                case Skill.Framework.AI.AccessKeyType.TimeLimit:
                    result = new TimeLimitAccessKeyData();
                    break;
                }
            }
            return(result);
        }
예제 #3
0
 public AccessKeyData(Skill.Framework.AI.AccessKeyType type)
 {
     this.Type = type;
     this.Key  = "";
 }