示例#1
0
        public IEnumerable <Item> GetEquipped(EquippedQueryMode mode = EquippedQueryMode.Any)
        {
            foreach (Item loopItem in this.Items)
            {
                if (loopItem.IsEquipped)
                {
                    switch (mode)
                    {
                    case EquippedQueryMode.Any:
                        yield return(loopItem);

                        break;

                    case EquippedQueryMode.Normal:
                        if (loopItem.Slot > -100)
                        {
                            yield return(loopItem);
                        }
                        break;

                    case EquippedQueryMode.Cash:
                        if (loopItem.Slot < -100)
                        {
                            yield return(loopItem);
                        }
                        break;
                    }
                }
            }
        }
示例#2
0
        public IEnumerable <Item> GetEquipped(EquippedQueryMode mode = EquippedQueryMode.Any)
        {
            foreach (Item loopItem in this.Items)
            {
                if (!loopItem.IsEquipped)
                {
                    continue;
                }

                switch (mode)
                {
                case EquippedQueryMode.Any:
                    yield return(loopItem);

                    break;

                case EquippedQueryMode.Normal:
                    if (loopItem.Slot > -100)
                    {
                        yield return(loopItem);
                    }
                    break;

                case EquippedQueryMode.Cash:
                    if (loopItem.Slot < -100)
                    {
                        yield return(loopItem);
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
                }
            }
        }