// Longhand operators /// <summary> /// Tests for equality between this percentage and another. /// </summary> /// <param name="right">The percentage against which this one is being compared.</param> /// <returns>A Boolean indicating whether or not the two percentages are equal.</returns> public bool Equals(percent right) { return Value == right.Value; }
/* CONSTRUCTOR METHOD */ /// <summary> /// Construct a biome with a completely known set of parameters. /// </summary> /// <param name="elevation"></param> /// <param name="humidity"></param> /// <param name="foliageDensity"></param> /// <param name="roughness"></param> /// <param name="temperature"></param> /// <param name="treesDensity"></param> public Biome(float elevation, percent humidity, percent foliageDensity, float roughness, float temperature, percent treesDensity) { // Fill in all determinate parameters Elevation = elevation; Humidity = humidity; Foliage = foliageDensity; Roughness = roughness; Temperature = temperature; Trees = treesDensity; ElevationGen = Vector2.Zero; RoughnessGen = Vector2.Zero; }
/// <summary> /// Converts a percentage value into its string representation. /// </summary> /// <param name="x">The percentage integer being converted.</param> /// <returns>The string representation of the inputted percentage integer.</returns> public static string ToString(percent x) { return x.ToString(); }
/// <summary> /// Converts a percentage value into a 32-bit signed integer value. /// </summary> /// <param name="x">The percentage integer being converted.</param> /// <returns>A signed integer that is equivalent to the inputted percentage integer.</returns> public static int ToInt(percent x) { return x.ToInt(); }
/// <summary> /// Converts a percentage value into a 32-bit single precision fractional value. /// </summary> /// <param name="x">The percentage integer being converted.</param> /// <returns>A single precision fraction of 1 equivalent to the inputted percentage integer.</returns> public static float ToFloat(percent x) { return x.ToFloat(); }
/// <summary> /// Converts a percentage value into a 64-bit double precision fractional value. /// </summary> /// <param name="x">The percentage integer being converted.</param> /// <returns>A double precision fraction of 1 equivalent to the inputted percentage integer.</returns> public static double ToDouble(percent x) { return x.ToDouble(); }
/// <summary> /// Test for equality between two percentage values. /// </summary> /// <param name="left">The first percentage value.</param> /// <param name="right">The second percentage value being compared with the first.</param> /// <returns>A Boolean indicating whether or not the two percentages are equal.</returns> public static bool Equals(percent left, percent right) { return left.Value == right.Value; }