Example #1
0
        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);
        }
Example #2
0
		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;
		}