public CarView ToCarView() { CarView carView = new CarView(); for (var i = 0; i < 16; i++) { carView.Chassi.Vecteurs.Add(_coords[i]); } carView.Chassi.Densite = _coords[16]; carView.Wheel1.Density = _coords[17]; carView.Wheel1.Radius = _coords[18]; carView.Wheel1.Vertex = (int) (_coords[19]); carView.Wheel2.Density = _coords[20]; carView.Wheel2.Radius = _coords[21]; carView.Wheel2.Vertex = (int) (_coords[22]); return carView; }
public static Car CreateFrom(CarView carView) { Car car = new Car(); for (var i = 0; i < 16; i++) { car._coords[i] = carView.Chassi.Vecteurs[i]; } car._coords[16] = carView.Chassi.Densite; car._coords[17] = carView.Wheel1.Density; car._coords[18] = carView.Wheel1.Radius; car._coords[19] = carView.Wheel1.Vertex; car._coords[20] = carView.Wheel2.Density; car._coords[21] = carView.Wheel2.Radius; car._coords[22] = carView.Wheel2.Vertex; return car; }