public static bool TryConvert(this CraftResource r, out LeatherType t) { if (r == CraftResource.None) { t = LeatherType.None; return(true); } if (r < CraftResource.RegularLeather) { t = LeatherType.None; return(false); } if (r > CraftResource.BarbedLeather) { t = LeatherType.None; return(false); } t = (LeatherType)r; return(true); }
public static bool TryConvert(this CraftResource r, out LeatherType t) { if (r == CraftResource.None) { t = LeatherType.None; return true; } if (r < CraftResource.RegularLeather) { t = LeatherType.None; return false; } if (r > CraftResource.BarbedLeather) { t = LeatherType.None; return false; } t = (LeatherType)r; return true; }