Beispiel #1
0
        static void Main(string[] args)
        {
            try
            {
                FightingServiceCountry FS_Bel = new FightingServiceCountry();
                LandForces LF_Bel = new LandForces(5000, 100000);

                LF_Bel.Add(new AutomaticWeapon("AK-74", 2.1, 3.92, 700, 150000, false));
                LF_Bel.Add(new AutomaticWeapon("СВД", 3.7, 7.62, 3700, 30000, true));
                LF_Bel.Add(new AutomaticWeapon("AK-47", 2.7, 3.92, 700, 150000, false));

                LF_Bel.Add(new CM_LandForces("БТР", 30, 70, 3));
                LF_Bel.Add(new CM_LandForces("БМП", 50, 20, 3));
                LF_Bel.Add(new CM_LandForces("БМО", 20, 21, 6));

                FS_Bel.AddLandForces(LF_Bel);

                Navy NA_Bel = new Navy(2000, 10000);

                NA_Bel.Add(new AutomaticWeapon("АДС", 1.7, 2.92, 100, 500, false));
                NA_Bel.Add(new AutomaticWeapon("AK-74", 2.1, 3.92, 700, 3000, false));
                NA_Bel.Add(new Handgun("ПММ", 1, 9, 100, 5000, false));
                NA_Bel.Add(new Handgun("ГРАЧ", 1.2, 9, 145, 1000, false));
                // string name, double distance, double mainBore, int endurance
                NA_Bel.Add(new CM_Navy("Ракетный крейсер Атлант", 800, 120, 50));
                NA_Bel.Add(new CM_Navy("Крейсер Атлант", 800, 170, 30));
                NA_Bel.Add(new CM_Navy("Подводная лодка Сом", 1500, 15, 90));

                FS_Bel.AddNavy(NA_Bel);

                Console.WriteLine(FS_Bel.ToString() + "\n=-=-=-=-=-= SORTED By Contingent =-=-=-=-=-=\n");
                FS_Bel.SortByContingent();
                Console.WriteLine(FS_Bel.ToString() + "\n=-=-=-=-=-=\n");
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.message);
            }
        }