Beispiel #1
0
 public void AddVehicle(int _x, int _y, VehicleStats _stats = null)
 {
     if (_stats == null)
     {
         _stats = getRandomStats();
     }
 }
Beispiel #2
0
        static public void addVehicleStats(string _name, int _weight, float _length, int _topspeed, int _motorpwr, int _surface, float _cw)
        {
            VehicleStats _temp = new VehicleStats(_name, _weight, _length, _topspeed, _motorpwr, _surface, _cw);

            if (vehicles.Find(x => x == _temp) == null)
            {
                vehicles.Add(_temp);
            }

            General_Form.Main.UserInterface.SimSVM.Selection_box.Add_Element(_temp.Name);
        }
Beispiel #3
0
        public Vehicle(VehicleStats _stat, int x, int y) : base(new Point(x, y), new Size(20, 20))
        {
            this.weight   = _stat.Weight;
            this.length   = _stat.Length;
            this.topspeed = _stat.Topspeed;
            this.name     = _stat.Name;
            this.motorpwr = _stat.Motorpwr;
            this.x        = x;
            this.y        = y;
            this.cw       = _stat.Cw;
            this.surface  = _stat.Surface;
            this.Cords    = new Point(x, y); //Ignore this

            a      = this.motorpwr / this.weight;
            abrake = physics.Brakepwr / this.weight;
            Car    = new Bitmap(Properties.Resources.Car);
        }
Beispiel #4
0
        static public VehicleStats getVehicleStat(string _name)
        {
            VehicleStats _temp = vehicles.Find(x => x.Name == _name);

            if (_temp == null)
            {
                try
                {
                    _temp = vehicles[0];
                }
                catch (Exception)
                {
                    _temp = new VehicleStats("", 1, 1, 1, 1, 1, 1);
                }
            }

            return(_temp);
        }