コード例 #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);
        }