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); }
public AbnormalStatusContent GetOrCreate(AbnormalStatusSource source, int count) { var result = Get(source); if (result == null) { result = Creat(source, count); } return(result); }
public AbnormalStatusContent Increase(AbnormalStatusSource source, int count) { if (source == null) { return(null); } var abnormalStatus = GetOrCreate(source, count); return(abnormalStatus); }
public AbnormalStatusContent Add(AbnormalStatusSource source, int count, params object[] args) { if (source.canRepeat) { return(Creat(source, count, args)); } else { return(Increase(source, count)); } }
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); }
public List <AbnormalStatusContent> GetAll(AbnormalStatusSource source) { var id = source.id; return(asList.Where(ac => ac.id == source.id).ToList()); }
public AbnormalStatusContent Get(AbnormalStatusSource source) { var id = source.id; return(asList.FirstOrDefault(ac => ac.id == source.id)); }
public bool ContainAbnormalStatus(AbnormalStatusSource source) { var result = asList.FirstOrDefault(ac => ac.id == source.id); return(result == null ? false : true); }