public static void SetColor(this Vehicle v, Vehicles.EPaint pColor) { if (v != null && v.Exists()) { v.SetColor(pColor, pColor); } }
public static void SetColor(this Vehicle v, Vehicles.EPaint primColor, Vehicles.EPaint secColor) { if (v != null && v.Exists()) { VehicleColor color = new VehicleColor(primColor, secColor); v.SetColor(color); } }
public static void SetRandomColor(this Vehicle v) { if (v != null && v.Exists()) { Random rand = new Random(Guid.NewGuid().GetHashCode()); Vehicles.ENormalPaint[] paintColors = (Vehicles.ENormalPaint[])Enum.GetValues(typeof(Vehicles.ENormalPaint)); Vehicles.ENormalPaint randColor = paintColors[rand.Next(paintColors.Length)]; Vehicles.EPaint selectedColor = (Vehicles.EPaint)Enum.Parse(typeof(Vehicles.EPaint), randColor.ToString()); v.SetColor(selectedColor); } }
public string GetColorName(Vehicles.EPaint paint) { String name = Enum.GetName(typeof(Vehicles.EPaint), paint); return(name.Replace("_", " ")); }
public VehicleColor(Vehicles.EPaint primColor, Vehicles.EPaint secColor) { this.PrimaryColor = primColor; this.SecondaryColor = secColor; }
public VehicleColor(Vehicles.EPaint color) { this.PrimaryColor = color; this.SecondaryColor = color; }