コード例 #1
0
        public SteeringEngine(Graphics graphics, Size clientSize, int vehicles)
        {
            _graphics   = graphics;
            _clientSize = clientSize;

            InitCars(vehicles);

            CustomObject.SetCarsData(ref _customObjects);
        }
コード例 #2
0
 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);
 }