public Car GetCar()
 {
     String playerName = this.rTextBoxPlayerName.GetValue();
     Color carColor = this.colorDialogCarColor.Color;
     Player driver = new Player(playerName);
     return new Car(driver, carColor);
 }
Esempio n. 2
0
 /// <summary>
 /// Car constructor
 /// </summary>
 /// <param name="playerPosition">Aka id or so</param>
 /// <param name="driver"></param>
 /// <param name="color"></param>
 /// <param name="map"></param>
 public Car(int playerPosition, Player driver, Color color, Map map)
 {
     this.SpeedHandlerUtility = new SpeedHandlerUtility();
     this.CarDirectionHandlerUtility = new CarDirectionHandlerUtility();
     this.PlayerPosition = playerPosition;
     this.Driver = driver;
     this.Color = color;
     this.Speed = map.CarStartSpeed;
     this.CarDirection = map.CarStartDirection;
     this.PreviousLocation = null;
     this.CurrentLocation = map.CarStartPositions[playerPosition];
     this.PossibleNextLocations = map.CalculatePossibleNextLocations(this.CurrentLocation, this.CarDirection, this.Speed);
     this.Map = map;
 }
        private void rButtonStartGame_Click(object sender, EventArgs e)
        {
            if (this.manageProfileWidget1.HasValidProfile() && this.manageMapWidget1.HasMapSelected())
            {
                Map map = this.manageMapWidget1.GetMap();
                String playerName = this.manageProfileWidget1.GetPlayerName();
                Color carColor = this.manageProfileWidget1.GetCarColor();

                Player player = new Player(playerName);
                Car car = new Car(0, player, carColor, map);

                this.ApplicationController.StartSingleplayerModeGame(car, map);
            }
            else
            {
                MessageBox.Show("Invalid configuration.");
            }
        }
Esempio n. 4
0
 public Car(int playerPosition, Player driver, Color color)
 {
     this.PlayerPosition = playerPosition;
     this.Driver = driver;
     this.Color = color;
 }
Esempio n. 5
0
 public Car(int playerPosition, Player driver)
 {
     this.PlayerPosition = playerPosition;
     this.Driver = driver;
 }