private List <SWAFItem> this[SWAFItem.SWAFItemType value] { get { List <SWAFItem> res = new List <SWAFItem>(); foreach (SWAFItem item in items) { if (item.ItemType == value) { res.Add(item); } } return(res); } }
int CountForType(SWAFItem.SWAFItemType type) { switch (type) { case SWAFItem.SWAFItemType.LifetimeWants: return(LifetimeWants.Count); case SWAFItem.SWAFItemType.Wants: return(Wants.Count); case SWAFItem.SWAFItemType.Fears: return(Fears.Count); default: return(-1); } }
int LimitForType(SWAFItem.SWAFItemType type) { switch (type) { case SWAFItem.SWAFItemType.LifetimeWants: return(version < 0x05 ? 0 : -1); case SWAFItem.SWAFItemType.Wants: return((int)maxWants); case SWAFItem.SWAFItemType.Fears: return((int)maxFears); default: return(-1); } }