public void AddVehicle(int _x, int _y, VehicleStats _stats = null) { if (_stats == null) { _stats = getRandomStats(); } }
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); }
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); }
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); }