static void Main(string[] args) { F16 ff = new F16(); Console.WriteLine(ff.GetType()); //int[,] arry = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; //int[,] rotated = RotateMatrix(arry); //DisplayMatrix(rotated); Console.WriteLine(RemoveSwearWords()); }
public void AddAircraft(string type) { if (type == "F16") { F16 f16 = new F16(); aircrafts.Add(f16); } else if (type == "F35") { F35 f35 = new F35(); aircrafts.Add(f35); } }
static void Main(string[] args) { Carrier redCarrier = new Carrier(300, 1000, "The magnificent RedCarrier destroyer of worlds."); F16 redF16_1 = new F16(); F35 redF35_1 = new F35(); F16 redF16_2 = new F16(); F35 redF35_2 = new F35(); redCarrier.AddAircraft(redF16_1); redCarrier.AddAircraft(redF35_1); redCarrier.AddAircraft(redF16_2); redCarrier.AddAircraft(redF35_2); redCarrier.FillAllAircraft(); redCarrier.FillAllAircraft(); Console.WriteLine(redCarrier.GetStatus()); Carrier blueCarrier = new Carrier(200, 500, "Some green boy, ready to be destroyed"); Carrier greenCarrier = new Carrier(200, 2000, "This one is thougher"); Console.WriteLine(); redCarrier.FillAllAircraft(); Console.WriteLine(redCarrier.GetStatus()); Console.WriteLine(); Console.WriteLine(blueCarrier.GetStatus()); Console.WriteLine(); Console.WriteLine(redCarrier.FigthtWithAllAircraft(blueCarrier)); Console.WriteLine(blueCarrier.GetSetcarrierHealth); Console.WriteLine(); redCarrier.FillAllAircraft(); Console.WriteLine(greenCarrier.GetStatus()); Console.WriteLine(); Console.WriteLine(redCarrier.FigthtWithAllAircraft(greenCarrier)); Console.WriteLine(greenCarrier.GetSetcarrierHealth); Console.ReadLine(); }
static void Main(string[] args) { F16 fighter1 = new F16(); F16 fighter2 = new F16(); F16 fighter3 = new F16(); F35 fighter4 = new F35(); F35 fighter5 = new F35(); F35 fighter6 = new F35(); List <Aircraft> aircrafts1 = new List <Aircraft> { fighter1, fighter2, fighter3 }; List <Aircraft> aircrafts2 = new List <Aircraft> { fighter4, fighter5, fighter6 }; Carrier carrier1 = new Carrier(aircrafts1); Carrier carrier2 = new Carrier(aircrafts2); //foreach (Aircraft item in aircrafts2) //{ // Console.WriteLine(item.GetStatus()); //} Console.WriteLine(); Console.WriteLine(carrier1.GetStatus()); // Console.WriteLine(carrier2.GetStatus()); Console.WriteLine(fighter1.Refill(5)); Console.WriteLine(); Console.WriteLine(carrier2.GetStatus()); F35 fighter7 = new F35(); carrier2.Add(fighter7); carrier2.Fill(); carrier1.Fill(); Console.WriteLine(); Console.WriteLine(carrier1.GetStatus()); Console.WriteLine(carrier2.GetStatus()); carrier2.Fight(carrier1); Console.WriteLine(carrier1.GetStatus()); Console.WriteLine(carrier2.GetStatus()); carrier1.Fight(carrier2); carrier2.Fill(); Console.WriteLine(carrier1.GetStatus()); Console.WriteLine(carrier2.GetStatus()); carrier2.Fight(carrier1); Console.WriteLine(carrier1.GetStatus()); Console.WriteLine(carrier2.GetStatus()); Console.ReadLine(); }