public LocoDriver(string name, TrainSet myTrain, RailRoad railroad)
 {
     this.name = name;
     this.trainSet = myTrain;
     this.railRoad = railroad;
     driverState = DriverState.Off;
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            RailRoadCtr rCtr = new RailRoadCtr();
            railroad = rCtr.loadRailRoad("Railroad2.xml", Content);

            TrainSet train1;
            train1 = new TrainSet("Train #1", new List<TrainCart>(), new Engine(30));

            TrainCart cart1 = new TrainCart(Content);
            cart1.currentTrack = railroad.tracks[0];
            cart1.previousTrack = railroad.tracks[25];
            cart1.position = 50;
            cart1.maxSpeed = 60;
            cart1.setCart();
            train1.cartList.Add(cart1);

            railroad.trains.Add(train1);

            train1.locoDriver =  new LocoDriver("Per", train1, railroad);

            TrainSet train2;
            train2 = new TrainSet("Train #2", new List<TrainCart>(), new Engine(20));

            TrainCart cart2 = new TrainCart(Content);
            cart2.currentTrack = railroad.tracks[27];
            cart2.previousTrack = railroad.tracks[26];
            cart2.position = 50;
            cart2.maxSpeed = 60;
            cart2.rotation = MathHelper.ToRadians(0);
            cart2.setCart();
            train2.cartList.Add(cart2);

            railroad.trains.Add(train2);

            train2.locoDriver = new LocoDriver("Ole", train2, railroad);
            //TrainCart cart2 = new TrainCart(Content);
            //cart2.currentTrack = railroad.tracks[1];
            //cart2.previousTrack = railroad.tracks[0];
            //cart2.position = 5;
            //cart2.maxSpeed = 60;
            //cart2.setCart();
            //train1.cartList.Add(cart2);

            //TrainCart cart3 = new TrainCart(Content);
            //cart3.currentTrack = railroad.tracks[0];
            //cart3.previousTrack = railroad.tracks[7];
            //cart3.position = 30;
            //cart3.maxSpeed = 60;
            //cart3.setCart();
            //train1.cartList.Add(cart3);

            whistle = Content.Load<SoundEffect>("train");
            initPanels(railroad);
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
        }