Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- public class Program
- {
- public static void Main()
- {
- }
- public class Vehicle
- {
- protected int Power{get;set;}
- public int MaxPassengers{get;set;}
- public int MaxCargo{get;set;}
- }
- public class MotorVehicle:Vehicle
- {
- }
- public class Van:Vehicle
- {
- }
- public class Car:Vehicle
- {
- }
- public class Bus:Vehicle
- {
- }
- public class AutoPark
- {
- protected List<Vehicle>totalVehicles{get;set;}
- }
- public class PublicTransportationAutopark
- {
- protected List<Vehicle>totalVehicles{get;set;}
- protected int MaxPassengers=>this.totalVehicles.Sum(v=>v.MaxPassengers);
- }
- public class LogisticsAutopark
- {
- protected List<Vehicle>totalVehicles{get;set;}
- protected int MaxPassengers=>this.totalVehicles.Sum(v=>v.MaxCargo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment