<commit_before>﻿using OfflineServer.Servers;
using OfflineServer.Servers.Database.Entities;
using OfflineServer.Servers.Database.Management;
using System;
using System.Xml.Linq;

namespace OfflineServer
{
    public enum CarClass
    {
        E = 872416321,
        D = 415909161,
        C = 1866825865,
        B = -406473455,
        A = -405837480,
        S = -2142411446
    }

    public class Car : ObservableObject
    {
        private Int32 id;
        private Int64 baseCarId;
        private CarClass raceClass;
        private XElement paints;
        private XElement performanceParts;
        private Int64 physicsProfileHash;
        private Int32 rating;
        private Int32 resalePrice;
        private XElement skillModParts;
        private XElement vinyls;
        private XElement visualParts;
        private Int16 durability;
        private DateTime expirationDate;
        private Int16 heatLevel;
        private Int64 carId;
        private Int32 personaId;
        public String MakeModel { get { return CarDefinitions.defineFromPhysicsProfileHash(PhysicsProfileHash, true); } }
        public String MakeModelDetailed { get { return CarDefinitions.defineFromBaseCarId(BaseCarId); } }


        public Int32 Id
        {
            get { return id; }
            set
            {
                if (id != value)
                {
                    id = value;
                    RaisePropertyChangedEvent("Id");
                }
            }
        }
        public Int64 BaseCarId
        {
            get { return baseCarId; }
            set
            {
                if (baseCarId != value)
                {
                    baseCarId = value;
                    CarManagement.car.baseCarId = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("BaseCarId");
                }
            }
        }
        public CarClass RaceClass
        {
            get { return raceClass; }
            set
            {
                if (raceClass != value)
                {
                    raceClass = value;
                    CarManagement.car.raceClass = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("RaceClass");
                }
            }
        }
        public XElement Paints
        {
            get { return paints; }
            set
            {
                if (paints != value)
                {
                    paints = value;
                    CarManagement.car.paints = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("Paints");
                }
            }
        }
        public XElement PerformanceParts
        {
            get { return performanceParts; }
            set
            {
                if (performanceParts != value)
                {
                    performanceParts = value;
                    CarManagement.car.performanceParts = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("PerformanceParts");
                }
            }
        }
        public Int64 PhysicsProfileHash
        {
            get { return physicsProfileHash; }
            set
            {
                if (physicsProfileHash != value)
                {
                    physicsProfileHash = value;
                    CarManagement.car.physicsProfileHash = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("PhysicsProfileHash");
                    RaisePropertyChangedEvent("MakeModel");
                }
            }
        }
        public Int32 Rating
        {
            get { return rating; }
            set
            {
                if (rating != value)
                {
                    rating = value;
                    CarManagement.car.rating = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("Rating");
                }
            }
        }
        public Int32 ResalePrice
        {
            get { return resalePrice; }
            set
            {
                if (resalePrice != value)
                {
                    resalePrice = value;
                    CarManagement.car.resalePrice = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("ResalePrice");
                }
            }
        }
        public XElement SkillModParts
        {
            get { return skillModParts; }
            set
            {
                if (skillModParts != value)
                {
                    skillModParts = value;
                    CarManagement.car.skillModParts = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("SkillModParts");
                }
            }
        }
        public XElement Vinyls
        {
            get { return vinyls; }<commit_msg>Limit resale price<commit_after>﻿using OfflineServer.Servers;
using OfflineServer.Servers.Database.Entities;
using OfflineServer.Servers.Database.Management;
using System;
using System.Xml.Linq;

namespace OfflineServer
{
    public enum CarClass
    {
        E = 872416321,
        D = 415909161,
        C = 1866825865,
        B = -406473455,
        A = -405837480,
        S = -2142411446
    }

    public class Car : ObservableObject
    {
        private Int32 id;
        private Int64 baseCarId;
        private CarClass raceClass;
        private XElement paints;
        private XElement performanceParts;
        private Int64 physicsProfileHash;
        private Int32 rating;
        private Int32 resalePrice;
        private XElement skillModParts;
        private XElement vinyls;
        private XElement visualParts;
        private Int16 durability;
        private DateTime expirationDate;
        private Int16 heatLevel;
        private Int64 carId;
        private Int32 personaId;
        public String MakeModel { get { return CarDefinitions.defineFromPhysicsProfileHash(PhysicsProfileHash, true); } }
        public String MakeModelDetailed { get { return CarDefinitions.defineFromBaseCarId(BaseCarId); } }


        public Int32 Id
        {
            get { return id; }
            set
            {
                if (id != value)
                {
                    id = value;
                    RaisePropertyChangedEvent("Id");
                }
            }
        }
        public Int64 BaseCarId
        {
            get { return baseCarId; }
            set
            {
                if (baseCarId != value)
                {
                    baseCarId = value;
                    CarManagement.car.baseCarId = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("BaseCarId");
                }
            }
        }
        public CarClass RaceClass
        {
            get { return raceClass; }
            set
            {
                if (raceClass != value)
                {
                    raceClass = value;
                    CarManagement.car.raceClass = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("RaceClass");
                }
            }
        }
        public XElement Paints
        {
            get { return paints; }
            set
            {
                if (paints != value)
                {
                    paints = value;
                    CarManagement.car.paints = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("Paints");
                }
            }
        }
        public XElement PerformanceParts
        {
            get { return performanceParts; }
            set
            {
                if (performanceParts != value)
                {
                    performanceParts = value;
                    CarManagement.car.performanceParts = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("PerformanceParts");
                }
            }
        }
        public Int64 PhysicsProfileHash
        {
            get { return physicsProfileHash; }
            set
            {
                if (physicsProfileHash != value)
                {
                    physicsProfileHash = value;
                    CarManagement.car.physicsProfileHash = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("PhysicsProfileHash");
                    RaisePropertyChangedEvent("MakeModel");
                }
            }
        }
        public Int32 Rating
        {
            get { return rating; }
            set
            {
                if (rating != value)
                {
                    rating = value;
                    CarManagement.car.rating = value;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("Rating");
                }
            }
        }
        public Int32 ResalePrice
        {
            get { return resalePrice; }
            set
            {
                if (resalePrice != value)
                {
                    resalePrice = Math.Min(value, Int32.MaxValue - 1);
                    CarManagement.car.resalePrice = resalePrice;
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("ResalePrice");
                }
            }
        }
        public XElement SkillModParts
        {
            get { return skillModParts; }
            set
            {
                if (skillModParts != value)
                {
                    skillModParts = value;
                    CarManagement.car.skillModParts = value.ToString(SaveOptions.DisableFormatting);
                    CarManagement.car.update();
                    RaisePropertyChangedEvent("SkillModParts");
                }
            }
        }
        public XElement Vinyls
        {
            get { return vinyls; }
{'fraction_non_alphanumeric': 0.06663456909003371, 'fraction_numerical': 0.01646605681271064, 'mean_word_length': 1.1287149005943842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6469902', 'n_tokens_mistral': 2568, 'n_tokens_neox': 2323, 'n_words': 484}