namespace TrainerMod.Framework { /// Provides extension methods on primitive types. public static class Extensions { /// Get whether an object is a number. /// The object value. public static bool IsInt(this object value) { int i; return int.TryParse(value.ToString(), out i); } /// Parse an object into a number. /// The object value. /// The value is not a valid number. public static int ToInt(this object value) { return int.Parse(value.ToString()); } } }