bool IsMetalItem(TF2BackpackItem asset) { if (!ShouldCraftAsset(asset)) return false; var item = GetItemFromDefIndex(asset.DefIndex); if (item == null) return false; if (!ShouldCraftItem(item, TF2CraftClass.CraftBar)) return false; if (item.DefIndex == 5000) // Scrap Metal return true; if (item.DefIndex == 5001) // Reclaimed Metal return true; return false; }
bool ShouldCraftAsset(TF2BackpackItem asset) { if (asset.CannotTrade || asset.CannotCraft) return false; if (asset.CustomName != null) return false; if (asset.CustomDescription != null) return false; return true; }
bool IsWeaponItem(TF2BackpackItem asset, TF2Class @class) { if (!ShouldCraftAsset(asset)) return false; var item = GetItemFromDefIndex(asset.DefIndex); if (item == null) return false; if (!ShouldCraftItem(item, TF2CraftClass.Weapon)) return false; if ((@class != TF2Class.Any) && !item.UsedByClasses.Contains(@class)) return false; return true; }