Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 /// <param name="name">The name of the passenger.</param>
 /// <param name="busStop">The company the passenger starts at.</param>
 /// <param name="companies">The list of all companies. This list, EXCEPT for the busStop company, will
 /// be placed in the Companies property in random order. The first will then be removed and set in Destination.</param>
 /// <param name="logo">Headshot of the passenger.</param>
 /// <param name="points">The number of points a player gets for delivering this passenger.</param>
 public Passenger(string name, Company busStop, IEnumerable<Company> companies, Bitmap logo, int points)
 {
     Name = name;
     Lobby = busStop;
     Companies = new List<Company>(companies.Where(cp => cp != busStop).OrderBy(item => rand.Next()));
     Destination = Companies[0];
     Companies.RemoveAt(0);
     Enemies = new List<Passenger>();
     Logo = logo;
     PointsDelivered = points;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Redraw this window. Call when status has changed.
        /// </summary>
        public void UpdateStats()
        {
            labelScore.Text = Player.Score.ToString("0.##");

            pictNoConnection.Visible = ! Player.IsConnected;

            if (Player.Passenger != passengerOn || Player.NextBusStop != nextBusStopOn || firstTime)
            {
                firstTime = false;

                if (Player.Passenger == null)
                {
                    labelPassenger.Text = @"{none}";
                    pictPassenger.Image = null;
                    if (Player.NextBusStop != null)
                    {
                        labelDestination.Text = Player.NextBusStop.Name;
                        pictDestination.Image = Player.NextBusStop.Logo;
                    }
                    else
                    {
                        labelDestination.Text = @"{none}";
                        pictDestination.Image = null;
                    }
                }
                else
                {
                    labelPassenger.Text = Player.Passenger.Name;
                    pictPassenger.Image = Player.Passenger.Logo;
                    labelDestination.Text = Player.Passenger.Destination.Name;
                    pictDestination.Image = Player.Passenger.Destination.Logo;
                }
                passengerOn = Player.Passenger;
                nextBusStopOn = Player.NextBusStop;
            }
            Invalidate(true);
        }
Ejemplo n.º 3
0
 public void EnterCar(Limo limo)
 {
     Start = Lobby;
     Lobby = null;
     Car = limo;
 }
Ejemplo n.º 4
0
 public void DebugAssign(Limo limo)
 {
     if (Start == null)
         Start = Lobby;
     Lobby = null;
     Car = limo;
 }
Ejemplo n.º 5
0
 public void Arrived(Company cmpny)
 {
     Destination = Companies.Count == 0 ? null : Companies[0];
     Companies.Remove(Destination);
     Lobby = Companies.Count == 0 ? null : cmpny;
     Start = null;
     Car = null;
 }
Ejemplo n.º 6
0
 public void Abandoned(Company cmpny)
 {
     Lobby = cmpny;
     Start = null;
     Car = null;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public CompanyInfo(Company src)
 {
     Trap.trap();
     Name = src.Name;
     BusStop = src.BusStop;
 }