Changed whole project structure (split client and server into separat projects)

This commit is contained in:
hydrant
2019-02-25 22:12:05 +01:00
parent d2181c4987
commit 33abb3d04f
185 changed files with 282 additions and 596 deletions

View File

@@ -0,0 +1,40 @@
using GTANetworkAPI;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace reallife_gamemode.Server.Util
{
public class Converter
{
public static Color HexToColor(string hexColor)
{
//Remove # if present
if (hexColor.IndexOf('#') != -1)
hexColor = hexColor.Replace("#", "");
int red = 0;
int green = 0;
int blue = 0;
if (hexColor.Length == 6)
{
//#RRGGBB
red = int.Parse(hexColor.Substring(0, 2), NumberStyles.AllowHexSpecifier);
green = int.Parse(hexColor.Substring(2, 2), NumberStyles.AllowHexSpecifier);
blue = int.Parse(hexColor.Substring(4, 2), NumberStyles.AllowHexSpecifier);
}
else if (hexColor.Length == 3)
{
//#RGB
red = int.Parse(hexColor[0].ToString() + hexColor[0].ToString(), NumberStyles.AllowHexSpecifier);
green = int.Parse(hexColor[1].ToString() + hexColor[1].ToString(), NumberStyles.AllowHexSpecifier);
blue = int.Parse(hexColor[2].ToString() + hexColor[2].ToString(), NumberStyles.AllowHexSpecifier);
}
Color returnColor = new Color(red, green, blue);
return returnColor;
}
}
}