Server.Items.AddonComponent.ApplyLightTo C# (CSharp) Méthode

ApplyLightTo() public static méthode

public static ApplyLightTo ( Server.Items.Item item ) : void
item Server.Items.Item
Résultat void
        public static void ApplyLightTo(Item item)
        {
            if ((item.ItemData.Flags & TileFlag.LightSource) == 0)
                return; // not a light source

            int itemID = item.ItemID;

            for (int i = 0; i < m_Entries.Length; ++i)
            {
                LightEntry entry = m_Entries[i];
                int[] toMatch = entry.m_ItemIDs;
                bool contains = false;

                for (int j = 0; !contains && j < toMatch.Length; ++j)
                    contains = (itemID == toMatch[j]);

                if (contains)
                {
                    item.Light = entry.m_Light;
                    return;
                }
            }
        }

Usage Example

Exemple #1
0
        public BaseAddonContainer(int itemID)
            : base(itemID)
        {
            AddonComponent.ApplyLightTo(this);

            m_Components = new List <AddonContainerComponent>();
        }
All Usage Examples Of Server.Items.AddonComponent::ApplyLightTo