This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class MiscUtils | |
| { | |
| /// <summary> | |
| /// Re-maps a number from one range to another. | |
| /// </summary> | |
| /// <typeparam name="Type">IConvertible-implementing type</typeparam> | |
| /// <param name="value">the incoming value to be converted</param> | |
| /// <param name="start1">lower bound of the value's current range</param> | |
| /// <param name="stop1">upper bound of the value's current range</param> | |
| /// <param name="start2">lower bound of the value's target range</param> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class MiscUtils | |
| { | |
| /// <summary> | |
| /// Constrains a value to not exceed a maximum and minimum value | |
| /// </summary> | |
| /// <typeparam name="Type">IComparable-implementing type</typeparam> | |
| /// <param name="value">the value to constrain</param> | |
| /// <param name="min">minimum limit</param> | |
| /// <param name="max">maximum limit</param> | |
| /// <returns>constrained value</returns> |
NewerOlder