コード例 #1
0
ファイル: Program.cs プロジェクト: Kinkio/Skole_projekter
        public void CostomerTrip()
        {
            Trip Trips = new Trip();

            //Taxi trip 1
            Trips.startHour = 10;
            Trips.startMinute = 25;
            Trips.endHour = 11;
            Trips.endMinute = 30;
            Trips.startingFee = 20;
            Trips.pricePrMinute = 1.50;

            TaxiTrips.Find(x => x.id.Equals(1)).AddTrip(Trips);

            Trip Trips1 = new Trip();

            //Taxi trip 2
            Trips1.startHour = 12;
            Trips1.startMinute = 30;
            Trips1.endHour = 13;
            Trips1.endMinute = 30;
            Trips1.startingFee = 20;
            Trips1.pricePrMinute = 2.50;

            TaxiTrips.Find(x => x.id.Equals(2)).AddTrip(Trips1);

            Trip Trips2 = new Trip();

            //Taxi trip 3
            Trips2.startHour = 8;
            Trips2.startMinute = 10;
            Trips2.endHour = 10;
            Trips2.endMinute = 15;
            Trips2.startingFee = 20;
            Trips2.pricePrMinute = 2.00;

            TaxiTrips.Find(x => x.id.Equals(3)).AddTrip(Trips2);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: pareion/TonsOfFun
        public void createTaxis()
        {
            taxis = new List<Taxi>();

            Taxi taxi1 = new Taxi();
            Taxi taxi2 = new Taxi();
            Taxi taxi3 = new Taxi();

            taxi1.Id = 1;
            taxi2.Id = 2;
            taxi3.Id = 3;

            taxi1.Driver = "Ole";
            taxi2.Driver = "Svend";
            taxi3.Driver = "Børge";

            Trip trip1 = new Trip();
            trip1.StartMinute = 1;
            trip1.StartHour = 23;
            trip1.EndHour = 1;
            trip1.EndMinute = 39;
            trip1.PricePrMinute = 20;

            Trip trip2 = new Trip();
            trip2.StartMinute = 0;
            trip2.StartHour = 0;
            trip2.EndHour = 8;
            trip2.EndMinute = 30;
            trip2.PricePrMinute = 10;

            Trip trip3 = new Trip();
            trip3.StartMinute = 0;
            trip3.StartHour = 0;
            trip3.EndHour = 15;
            trip3.EndMinute = 0;
            trip3.PricePrMinute = 5;

            Trip trip4 = new Trip();
            trip4.StartMinute = 0;
            trip4.StartHour = 0;
            trip4.EndHour = 6;
            trip4.EndMinute = 30;
            trip4.PricePrMinute = 15;

            Trip trip5 = new Trip();
            trip5.StartMinute = 30;
            trip5.StartHour = 4;
            trip5.EndHour = 8;
            trip5.EndMinute = 30;
            trip5.PricePrMinute = 10;

            Trip trip6 = new Trip();
            trip6.StartMinute = 35;
            trip6.StartHour = 6;
            trip6.EndHour = 15;
            trip6.EndMinute = 32;
            trip6.PricePrMinute = 5;

            Trip trip7 = new Trip();
            trip7.StartMinute = 35;
            trip7.StartHour = 2;
            trip7.EndHour = 6;
            trip7.EndMinute = 46;
            trip7.PricePrMinute = 7;

            Trip trip8 = new Trip();
            trip8.StartMinute = 30;
            trip8.StartHour = 4;
            trip8.EndHour = 8;
            trip8.EndMinute = 30;
            trip8.PricePrMinute = 10;

            Trip trip9 = new Trip();
            trip9.StartMinute = 0;
            trip9.StartHour = 0;
            trip9.EndHour = 15;
            trip9.EndMinute = 0;
            trip9.PricePrMinute = 5;

            Trip trip10 = new Trip();
            trip10.StartMinute = 0;
            trip10.StartHour = 0;
            trip10.EndHour = 6;
            trip10.EndMinute = 30;
            trip10.PricePrMinute = 15;

            taxi1.Trips.Add(trip1);
            taxi1.Trips.Add(trip2);
            taxi1.Trips.Add(trip3);
            taxi1.Trips.Add(trip4);

            taxi2.Trips.Add(trip5);
            taxi2.Trips.Add(trip6);
            taxi2.Trips.Add(trip7);

            taxi3.Trips.Add(trip8);
            taxi3.Trips.Add(trip9);
            taxi3.Trips.Add(trip10);

            taxis.Add(taxi1);
            taxis.Add(taxi2);
            taxis.Add(taxi3);
        }
コード例 #3
0
ファイル: Taxi.cs プロジェクト: Kinkio/Skole_projekter
 public void AddTrip(Trip trip)
 {
     taxiList.Add(trip);
 }