public static void Main() { TankFactory tiger = new GermanTankFactory(); tiger.CreateTank(); TankFactory t34 = new RussianTankFactory(); t34.CreateTank(); TankFactory m1Abrams = new AmericanTankFactory(); m1Abrams.CreateTank(); Console.WriteLine(tiger); Console.WriteLine(t34); Console.WriteLine(m1Abrams); }
public static void Main() { TankFactory russianFactory = new RussianTankFactory(); TankFactory germanFactory = new GermanTankFactory(); TankFactory americanFactory = new AmericanTankFactory(); var tiger = new Tank("Tiger", 4.5, 120); var t34 = new Tank("T 34", 3.3, 75); var m1Abrams = new Tank("M1 Abrams", 5.4, 120); Console.WriteLine(tiger); Console.WriteLine(t34); Console.WriteLine(m1Abrams); }
static void Main() { TankFactory tankFactory = new GermanTankFactory(); var germanTank = tankFactory.CreateTank(); Console.WriteLine(germanTank); tankFactory = new AmericanTankFactory(); var americanTank = tankFactory.CreateTank(); Console.WriteLine(americanTank); tankFactory = new RussianTankFactory(); var russianTank = tankFactory.CreateTank(); Console.WriteLine(russianTank); }
static void Main() { TankFactory tankFactory = new GermanTankFactory(); var tank1 = tankFactory.CreateTank(); Console.WriteLine(tank1); tankFactory = new RussianTankFactory(); var tank2 = tankFactory.CreateTank(); Console.WriteLine(tank2); tankFactory = new AmericanTankFactory(); var tank3 = tankFactory.CreateTank(); Console.WriteLine(tank3); }