Server.Items.CraftResources.GetFromType C# (CSharp) Méthode

GetFromType() public static méthode

Returns the CraftResource value for which 'resourceType' uses -or- CraftResource.None if an unregistered type was specified.
public static GetFromType ( Type resourceType ) : CraftResource
resourceType System.Type
Résultat CraftResource
		public static CraftResource GetFromType( Type resourceType )
		{
			if ( m_TypeTable == null )
				return CraftResource.None;

			object obj = m_TypeTable[resourceType];

			if ( !(obj is CraftResource) )
				return CraftResource.None;

			return (CraftResource)obj;
		}

Usage Example

Exemple #1
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            this.Quality = (ItemQuality)quality;

            if (makersMark)
            {
                this.Crafter = from;
            }

            if (!craftItem.ForceNonExceptional)
            {
                if (typeRes == null)
                {
                    typeRes = craftItem.Resources.GetAt(0).ItemType;
                }

                Resource = CraftResources.GetFromType(typeRes);
            }

            return(quality);
        }
All Usage Examples Of Server.Items.CraftResources::GetFromType