public void DataToOptions()
        {
            if (data == null)
            {
                return;
            }

            options = new VehicleOptions[data.Length];

            for (int i = 0; i < data.Length; i++)
            {
                if (data[i].name == null)
                {
                    continue;
                }

                options[i]                    = new VehicleOptions();
                options[i].name               = data[i].name;
                options[i].enabled            = data[i].enabled;
                options[i].addBackEngine      = data[i].addBackEngine;
                options[i].maxSpeed           = data[i].maxSpeed;
                options[i].acceleration       = data[i].acceleration;
                options[i].braking            = data[i].braking;
                options[i].useColorVariations = data[i].useColorVariations;
                options[i].color0             = data[i].color0;
                options[i].color1             = data[i].color1;
                options[i].color2             = data[i].color2;
                options[i].color3             = data[i].color3;
                options[i].capacity           = data[i].capacity;
            }

            VehicleOptions.UpdateTransfertVehicles();
        }
 public static void RestoreAll()
 {
     foreach (string name in m_default.Keys)
     {
         Restore(m_prefabs[name]);
     }
     VehicleOptions.UpdateTransfertVehicles();
 }
        public static void CheckForConflicts()
        {
            StringBuilder conflicts = new StringBuilder();

            foreach (string name in m_default.Keys)
            {
                VehicleOptions options = new VehicleOptions();
                options.SetPrefab(m_prefabs[name]);

                DefaultOptions modded = m_modded[name];
                DefaultOptions stored = m_default[name];

                StringBuilder details = new StringBuilder();

                if (modded.m_enabled != stored.m_enabled && options.enabled == stored.m_enabled)
                {
                    options.enabled = modded.m_enabled;
                    details.Append("enabled, ");
                }
                if (modded.m_addBackEngine != stored.m_addBackEngine && options.addBackEngine == stored.m_addBackEngine)
                {
                    options.addBackEngine = modded.m_addBackEngine;
                    details.Append("back engine, ");
                }
                if (modded.m_maxSpeed != stored.m_maxSpeed && options.maxSpeed == stored.m_maxSpeed)
                {
                    options.maxSpeed = modded.m_maxSpeed;
                    details.Append("max speed, ");
                }
                if (modded.m_acceleration != stored.m_acceleration && options.acceleration == stored.m_acceleration)
                {
                    options.acceleration = modded.m_acceleration;
                    details.Append("acceleration, ");
                }
                if (modded.m_braking != stored.m_braking && options.braking == stored.m_braking)
                {
                    options.braking = modded.m_braking;
                    details.Append("braking, ");
                }
                if (modded.m_capacity != stored.m_capacity && options.capacity == stored.m_capacity)
                {
                    options.capacity = modded.m_capacity;
                    details.Append("capacity, ");
                }

                if (details.Length > 0)
                {
                    details.Length -= 2;
                    conflicts.AppendLine(options.name + ": " + details);
                }
            }

            if (conflicts.Length > 0)
            {
                VehicleOptions.UpdateTransfertVehicles();
                DebugUtils.Log("Conflicts detected (this message is harmless):" + Environment.NewLine + conflicts);
            }
        }