コード例 #1
0
        public Autopilot Clone()
        {
            var r = new Autopilot(Task, Output.PIDSetup.Clone())
            {
                Map          = Map,
                IsTestMode   = IsTestMode,
                MaxHVelocity = MaxHVelocity,
            };

            return(r);
        }
コード例 #2
0
        public HelicopterBase(Game game, TestConfiguration testConfiguration, TerrainCollision collision, 
            ICameraProvider cameraProvider, BasicEffect effect, SunlightParameters skyParams, HelicopterScenario scenario, 
            bool playEngineSound, bool isPlayerControlled, bool drawText)
            : base(game)
        {
            if (game == null || cameraProvider == null || effect == null || skyParams == null)
                throw new ArgumentNullException("", @"One or several of the necessary arguments were null!");

            

            _game = game;
            _testConfiguration = testConfiguration;
            _sensorSpecifications = testConfiguration.Sensors;
            _collision = collision;
            _flyBySensors = testConfiguration.FlyBySensors;

            if (_collision != null)
                _collision.CollidedWithTerrain += gameTime => Crashed(gameTime);
                

            _basicEffect = effect;
            _skyParams = skyParams;
            _scenario = scenario;
            _drawText = drawText;
            _cameraProvider = cameraProvider;
            IsPlayerControlled = isPlayerControlled;

            _playEngineSound = playEngineSound;

            _estimatedState = new HeliState();

            PIDSetup pidSetup = SimulatorResources.GetPIDSetups()[0];
            Autopilot = new Autopilot(_scenario.Task, pidSetup);
            Log = new List<HelicopterLogSnapshot>();
        }
コード例 #3
0
 public Autopilot Clone()
 {
     var r = new Autopilot(Task, Output.PIDSetup.Clone())
                 {
                     Map = Map,
                     IsTestMode = IsTestMode,
                     MaxHVelocity = MaxHVelocity,
                 };
     return r;
 }