Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="BaseRenderTypes"></param>
        /// <returns></returns>
        public RoomObjectList GetItemsByBaseRenderTypes(byte[] BaseRenderTypes)
        {
            RoomObjectList list = new RoomObjectList(this.Capacity);

            foreach (RoomObject entry in this)
            {
                foreach (BaseRenderType brt in BaseRenderTypes)
                {
                    switch (brt)
                    {
                    case BaseRenderType.CREATURE:
                        if (entry.Flags.IsCreature)
                        {
                            list.Add(entry);
                        }
                        break;

                    case BaseRenderType.PLAYER:
                        if (entry.Flags.IsPlayer)
                        {
                            list.Add(entry);
                        }
                        break;

                    case BaseRenderType.ITEM:
                        if (entry.Flags.IsGettable)
                        {
                            list.Add(entry);
                        }
                        break;

                    case BaseRenderType.NPC:
                        if (entry.Flags.IsBuyable)
                        {
                            list.Add(entry);
                        }
                        break;
                    }
                }
            }
            return(list);
        }
Beispiel #2
0
        /// <summary>
        /// Returns list with contained items flagged as Enemy, GuildMate or Friend.
        /// </summary>
        /// <returns></returns>
        public RoomObjectList GetItemsByPVPFlags()
        {
            RoomObjectList list = new RoomObjectList();

            foreach (RoomObject entry in this)
            {
                if (entry.Flags.IsEnemy ||
                    entry.Flags.IsGuildMate ||
                    entry.Flags.IsFriend)
                {
                    list.Add(entry);
                }
            }

            return(list);
        }