Пример #1
0
 /*public AutomatedCar(int x, int y, string filename)
  *  : base(x, y, filename, true,  new RotationMatrix(1.0, 0.0, 0.0, 1.0))*/
 public AutomatedCar(int x, int y, string filename, int width, int height, List <List <Point> > polylist)
     : base(x, y, filename, width, height, -width / 2, -height / 2, new Matrix(1, 0, 0, 1, 1, 1), polylist)
 {
     this.virtualFunctionBus = new VirtualFunctionBus();
     this.AEB = new AEB(this.virtualFunctionBus);
     this.humanMachineInterface = new HumanMachineInterface(this.virtualFunctionBus);
     this.accController         = new AccController(this.virtualFunctionBus);
     this.powerTrain            = new PowerTrain(this.virtualFunctionBus, x, y);
     this.gameOver    = new GameOverCondition(this.virtualFunctionBus);
     this.Brush       = new SolidColorBrush(Color.Parse("red"));
     this.Ultrasounds = new Ultrasound[]
     {
         new Ultrasound(this.virtualFunctionBus, 110, 30, 0),
         new Ultrasound(this.virtualFunctionBus, 105, 45, 90),
         new Ultrasound(this.virtualFunctionBus, 110, -30, 0),
         new Ultrasound(this.virtualFunctionBus, 105, -45, -90),
         new Ultrasound(this.virtualFunctionBus, -120, 25, 180),
         new Ultrasound(this.virtualFunctionBus, -105, 45, 90),
         new Ultrasound(this.virtualFunctionBus, -120, -25, 180),
         new Ultrasound(this.virtualFunctionBus, -105, -45, -90),
     };
     this.Radar             = new Radar(this.virtualFunctionBus);
     this.ultraSoundVisible = false;
     this.radarVisible      = false;
     this.cameraVisible     = false;
     this.polygonVisible    = false;
 }
Пример #2
0
        public override void TestDrive()
        {
            var speed = PowerTrain.TransferEnergy(800);

            PrintSpeed(speed);

            speed = PowerTrain.TransferEnergy(1200);

            PrintSpeed(speed);
        }