Пример #1
0
        public AbnormalStatusContent Creat(AbnormalStatusSource source, int count, params object[] args)
        {
            var content = source.Generate(owner, args);

            content.Increase(count);
            asList.Add(content);
            owner.OnAddAStatus();
            return(content);
        }
Пример #2
0
        public AbnormalStatusContent GetOrCreate(AbnormalStatusSource source, int count)
        {
            var result = Get(source);

            if (result == null)
            {
                result = Creat(source, count);
            }
            return(result);
        }
Пример #3
0
        public AbnormalStatusContent Increase(AbnormalStatusSource source, int count)
        {
            if (source == null)
            {
                return(null);
            }
            var abnormalStatus = GetOrCreate(source, count);

            return(abnormalStatus);
        }
Пример #4
0
 public AbnormalStatusContent Add(AbnormalStatusSource source, int count, params object[] args)
 {
     if (source.canRepeat)
     {
         return(Creat(source, count, args));
     }
     else
     {
         return(Increase(source, count));
     }
 }
Пример #5
0
 public void Init(AbnormalStatusSource source, BattleCharacter owner, Dictionary <string, PropertyInfo> descOption, params object[] args)
 {
     this.source      = source;
     id               = source.id;
     this.isTurnBased = source.isTurnBased;
     this.showCount   = source.showCount;
     this.canRepeat   = source.canRepeat;
     this.type        = source.type;
     this.owner       = owner;
     this.descOption  = descOption;
     this.desc        = source.desc;
     Generate(args);
 }
Пример #6
0
        public List <AbnormalStatusContent> GetAll(AbnormalStatusSource source)
        {
            var id = source.id;

            return(asList.Where(ac => ac.id == source.id).ToList());
        }
Пример #7
0
        public AbnormalStatusContent Get(AbnormalStatusSource source)
        {
            var id = source.id;

            return(asList.FirstOrDefault(ac => ac.id == source.id));
        }
Пример #8
0
        public bool ContainAbnormalStatus(AbnormalStatusSource source)
        {
            var result = asList.FirstOrDefault(ac => ac.id == source.id);

            return(result == null ? false : true);
        }