public SteeringEngine(Graphics graphics, Size clientSize, int vehicles) { _graphics = graphics; _clientSize = clientSize; InitCars(vehicles); CustomObject.SetCarsData(ref _customObjects); }
private void InitCars(int carCount) { _customObjects = new CustomObject[carCount]; for (var i = 0; i < carCount; i++) { var car = new CustomObject(_graphics, _clientSize, SB.Seek, i); _customObjects[i] = car; } CustomObject.SetCarsData(ref _customObjects); }