55 lines
1.0 KiB
C#
55 lines
1.0 KiB
C#
using OOP;
|
|
using OOP.Animals;
|
|
using OOP.Figures;
|
|
using OOP.Payment;
|
|
using OOP.RPG;
|
|
|
|
List<Vehicle> listOfVehicleObjects = new List<Vehicle>()
|
|
{
|
|
new Vehicle(),
|
|
new Bicycle(),
|
|
new Car()
|
|
};
|
|
|
|
foreach (var vehicle in listOfVehicleObjects)
|
|
{
|
|
vehicle.Drive();
|
|
}
|
|
|
|
List<Animal> listOfAnimals = new List<Animal>()
|
|
{
|
|
new Lion(),
|
|
new Parrot(),
|
|
new Elephant()
|
|
};
|
|
|
|
foreach (var animal in listOfAnimals)
|
|
{
|
|
Console.WriteLine($"{animal.Name} says:");
|
|
animal.MakeSound();
|
|
}
|
|
|
|
List<GenericPayment> listOfPaymentProviders = new List<GenericPayment>()
|
|
{
|
|
new GenericPayment(),
|
|
new PayPalPayment(),
|
|
new CreditCardPayment()
|
|
};
|
|
|
|
foreach (var pay in listOfPaymentProviders)
|
|
{
|
|
pay.ProcessPayment();
|
|
}
|
|
|
|
List<Shape> listOfShapes = new List<Shape>()
|
|
{
|
|
new Circle(5),
|
|
new Rectangle(10, 5),
|
|
};
|
|
|
|
foreach (var shape in listOfShapes)
|
|
{
|
|
Console.WriteLine($"{shape.GetType().Name} - Area: {shape.GetArea()} Perimiter: {shape.GetPerimeter()}");
|
|
}
|
|
|
|
new Simulation(new Warrior(10), new Mage(20)).StartSimulation(); |