Adding assignments
This commit is contained in:
55
Program.cs
Normal file
55
Program.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user