Add BBCODE to Horse Descriptions, Player Descriptions and Ranch Descriptions.

This commit is contained in:
SilicaAndPina 2021-02-13 17:47:28 +13:00
parent bdebe4d84a
commit 72bc81d900
14 changed files with 142 additions and 40 deletions

View file

@ -9,11 +9,6 @@ namespace HISP.Server
private static int getHexVal(char hex)
{
int val = (int)hex;
//For uppercase A-F letters:
//return val - (val < 58 ? 48 : 55);
//For lowercase a-f letters:
//return val - (val < 58 ? 48 : 87);
//Or the two combined, but a bit slower:
return val - (val < 58 ? 48 : (val < 97 ? 55 : 87));
}
public static byte[] StringToByteArray(string hex)
@ -31,6 +26,8 @@ namespace HISP.Server
return arr;
}
public static Double PointsToDistance(int x1, int y1, int x2, int y2)
{
return Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));