Example #1
0
        static void Main(string[] args)
        {
            //SpecialCustomers sc = null;
            ////sc = new SpecialCustomers();
            //sc = new TopNCustomers();

            //for (int i = 0; i < 10; i++)
            //{
            //    Customer obj = new Customer();
            //    sc.AddCustomer(obj);
            //}

            Mustang myMustang = null;

            myMustang = new MustangGT();

            myMustang.Break();

            if (myMustang.Stopped == true)
            {
                Console.WriteLine("Yeah, we didn't hit the wall!");
            }
            else
            {
                Console.WriteLine("Dang, we died!");
            }
        }
Example #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            ICar <IEngine> test = new Mustang(new V8Engine("ca412e5e-a731-4b9c-8176-1341035db2fa"));

            var cars = new List <ICar <IEngine> >
            {
                new Mustang(new V8Engine("a54824fa-3190-412d-846c-ec406cd3cd1d")),
                new Mustang(new V8Engine("a54824fa-3190-3190-846c-ec406cd3cd1d")),
                new Mustang(new V8Engine("a54824fa-846c-412d-846c-ec406cd3cd1d")),
                new Mustang(new V8Engine("a54824fa-846c-3190-846c-ec406cd3cd1d")),
                new Trabant(new ClassicEngine("a54824fa-846c-412d-412d-ec406cd3cd1d")),
                new Trabant(new ClassicEngine("a54824fa-846c-412d-412d-ec406cd3cd1d")),
                new Trabant(new ClassicEngine("a54824fa-846c-412d-412d-ec406cd3cd1d")),
            };

            var allCarsWithV8Engine = ExtensionMethods.GetAllCarsWithV8Engine(cars);
            IEnumerable <ICar <IEngine> > allCarsByEngineNonGeneric = cars.GetAllCarsWithV8Engine();

            var allCarsByEngineStaticCalling = ExtensionMethods.GetAllCarsByEngine <V8Engine>(cars);
            IEnumerable <ICar <IEngine> > allCarsByEngine = cars.GetAllCarsByEngine <V8Engine>();

            foreach (var i in Fibonaci.GetFibonacci().Skip(6).Take(15))
            {
                Console.WriteLine(i);
            }

            Extensions.Test();
        }
Example #3
0
        private void RewardWinner(Mobile player)
        {
            if (SingletonEvent.Instance.IsAutomaticEvent || SingletonEvent.Instance.CurrentEventRewardList.Count == 0)
            {
                IMount mount = new Mustang();
                if (mount != null)
                {
                    mount.Rider = player;
                }

                player.BankBox.DropItem(new Gold(10000));
            }
            else
            {
                RewardUtil.SendRewardToPlayer(player);
            }

            player.SendMessage(0x35, "O Premio de Vencedor foi depositado em seu banco!");

            if (this.eventStatistics.GetPlayerKillList((PlayerMobile)player).Count > 0)
            {
                int qtExtraGold = 5000 * this.eventStatistics.GetPlayerKillList((PlayerMobile)player).Count;

                player.BankBox.DropItem(new Gold(qtExtraGold));
                player.SendMessage(0x35, string.Format("Voce recebeu um premio extra de {0} Golds, por eliminar {1} inimigos.", qtExtraGold, this.eventStatistics.GetPlayerKillList((PlayerMobile)player).Count));
            }

            player.SendGump(new AlertGump(player, "O Premio de Vencedor foi depositado em seu banco!", "PARABÉNS!"));
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("OperatorOverloadingExample");

            var f150    = new F150(300);
            var mustang = new Mustang(400);

            mustang <<= 12;                         // 400 << 12 = 1638400
            var power2 = 400 << 12;                 // 1638400
            var equ    = mustang.Power == power2;   // true
        }
Example #5
0
        public static void Main(string[] args)
        {
            var airTrafficControl = new AirTrafficControl();

            var fighter1 = new Junkers("JC123", airTrafficControl);
            var fighter2 = new Lancaster("LA456", airTrafficControl);
            var fighter3 = new Mustang("MS789", airTrafficControl);
            var fighter4 = new Spitfire("SF3121", airTrafficControl);
            var fighter5 = new Stuka("ST6059", airTrafficControl);

            fighter1.Altitude += 25000;
            fighter2.Altitude += 25000;
            fighter3.Altitude += 25000;
            fighter4.Altitude += 25000;
            fighter5.Altitude += 25000;

            Console.ReadLine();
        }
Example #6
0
    // le bot souhaite joeur un Mustang
    void PlayMustangBot(List <int> botHand, List <int> botBoard, List <int> playedThisTurn, int i)
    {
        bool alreadyPlayed = false;

        for (int k = 0; k < botBoard.Count; k++)
        {
            if (allCards.cardList[botBoard[k]].getCardName() == "MUSTANG")
            {
                alreadyPlayed = true;
            }
        }
        if (alreadyPlayed == false)
        {
            Mustang m = new Mustang();
            m.PlayBot(botHand[i]);
            botBoard.Add(botHand[i]);
            playedThisTurn.Add(i);
            Debug.Log("Joue Mustang");
        }
    }
Example #7
0
            internal Item Construct()
            {
                try
                {
                    Item item;

                    if (Type == typeof(Gold))
                    {
                        item = new Gold(Amount);
                    }
                    else if (Type == typeof(ImagineNickel))
                    {
                        item = new ImagineNickel(Amount);
                    }
                    else if (Type == typeof(BaseWeapon))
                    {
                        BaseWeapon w = Loot.RandomWeapon();
                        w.DamageLevel = WeaponDamageLevel.Vanq;
                        int accuracyRoll = Utility.Random(99);
                        if (accuracyRoll < 31) // 30% to get Accurate
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Accurate;
                        }
                        else if (accuracyRoll < 56) // 25% to get Surpassingly
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
                        }
                        else if (accuracyRoll < 76) // 20% to get Eminently
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Eminently;
                        }
                        else if (accuracyRoll < 91) // 15% to get Exceedingly
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Exceedingly;
                        }
                        else if (accuracyRoll < 100) // 10% to get Supremely
                        {
                            w.AccuracyLevel = WeaponAccuracyLevel.Supremely;
                        }
                        item = w;
                    }
                    else if (Type == typeof(BaseArmor))
                    {
                        BaseArmor armor = Loot.RandomArmorOrShield();
                        armor.ProtectionLevel = ArmorProtectionLevel.Invulnerability;
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        item = armor;
                    }
                    else if (Type == typeof(BaseClothing))
                    {
                        item          = Loot.RandomClothing();
                        item.LootType = LootType.Blessed;
                        item.Hue      = Utility.RandomList(Sphere.RareHues);
                    }
                    else if (Type == typeof(BaseJewel))
                    {
                        item          = Loot.RandomJewelry();
                        item.LootType = LootType.Blessed;
                        item.Hue      = Utility.RandomList(Sphere.RareHues);
                    }
                    else if (Type == typeof(Mustang))
                    {
                        Mustang m = new Mustang();
                        MustangCollection.Randomize().ApplyTo(m);
                        item = new ShrinkItem(m);
                    }
                    else
                    {
                        item = Activator.CreateInstance(Type) as Item;
                    }
                    return(item);
                }
                catch
                {
                }
                return(null);
            }
Example #8
0
        public static void Main(string[] args)
        {
            try
            {
                System.Diagnostics.Debug.Write("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");
                Console.Error.Write("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");

                using (AbstractVehicle v1 = new Vehicle())
                {
                    v1.Registered = true;
                    v1.TSetHasLicensePlate(true);
                    PrintAbstractVehicle("Vehicle", v1);
                }

                using (AbstractVehicle v2 = new Mustang())
                {
                    v2.Registered = false;
                    v2.TSetHasLicensePlate(false);
                    PrintAbstractVehicle("Mustang", v2);

                    // For coverage of the "main-like" methods in Mustang.cxx:
                    //
                    Mustang m2 = v2 as Mustang;
                    if (m2 != null)
                    {
                        m2.VirtualMainPlus(333.333, args, 333);
                        m2.NonVirtualMain(args);
                    }

                    Mustang.main(args);
                }

                using (AbstractVehicle v3 = new GenericMotorCycle())
                {
                    v3.VIN = "C# VIN";
                    PrintAbstractVehicle("GenericMotorCycle", v3);
                }

                using (AbstractVehicle v4 = new GenericSUV())
                {
                    PrintAbstractVehicle("GenericSUV", v4);

                    // Add some additional coverage by calling these methods
                    // that are not already called elsewhere:
                    //
                    int discard = v4.TGet_BTX_ETX_Int();
                    if (0 == discard)
                    {
                        Console.Error.Write("discard is 0");
                    }

                    v4.TSetManufacturerID(VehicleDescriptor.ManufacturerID.EtcEtcEtc);
                    v4.TSetCallback(new AbstractVehicle.AVCallback(AvCallbackTestCallback), System.IntPtr.Zero);
                }
            }
            catch (Exception exc)
            {
                string s = exc.ToString();
                System.Diagnostics.Debug.Write(s);
                Console.Error.Write(s);
                throw;
            }
        }
        static void Main(string[] args)
        {
            Mustang auto = new Mustang();

            auto.Jedz(100, 200, 4, "Wrrr");
        }
Example #10
0
        public static void Main(string[] args)
        {
            try
              {
            System.Diagnostics.Debug.Write("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");
            Console.Error.Write("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");

            using (AbstractVehicle v1 = new Vehicle())
            {
              v1.Registered = true;
              v1.TSetHasLicensePlate(true);
              PrintAbstractVehicle("Vehicle", v1);
            }

            using (AbstractVehicle v2 = new Mustang())
            {
              v2.Registered = false;
              v2.TSetHasLicensePlate(false);
              PrintAbstractVehicle("Mustang", v2);

              // For coverage of the "main-like" methods in Mustang.cxx:
              //
              Mustang m2 = v2 as Mustang;
              if (m2 != null)
              {
            m2.VirtualMainPlus(333.333, args, 333);
            m2.NonVirtualMain(args);
              }

              Mustang.main(args);
               }

            using (AbstractVehicle v3 = new GenericMotorCycle())
            {
              v3.VIN = "C# VIN";
              PrintAbstractVehicle("GenericMotorCycle", v3);
            }

            using (AbstractVehicle v4 = new GenericSUV())
            {
              PrintAbstractVehicle("GenericSUV", v4);

              // Add some additional coverage by calling these methods
              // that are not already called elsewhere:
              //
              int discard = v4.TGet_BTX_ETX_Int();
              if (0 == discard)
              {
            Console.Error.Write("discard is 0");
              }

              v4.TSetManufacturerID(VehicleDescriptor.ManufacturerID.EtcEtcEtc);
              v4.TSetCallback(new AbstractVehicle.AVCallback(AvCallbackTestCallback), System.IntPtr.Zero);
               }
              }
              catch(Exception exc)
              {
            string s = exc.ToString();
            System.Diagnostics.Debug.Write(s);
            Console.Error.Write(s);
            throw;
              }
        }