Beispiel #1
0
        public static ChinaView Create(China o)
        {
            var v = new ChinaView();

            Copy.Members(o.Data, v);

            return(v);
        }
Beispiel #2
0
        public static China Create(ChinaView v)
        {
            var o = new China();

            Copy.Members(v, o.Data);

            return(o);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Country country1 = new China(100, 5, 15, 25);
            Country country2 = new USA(100, 20, 30, 30);

            War.Start(country1, country2);

            Console.ReadLine();
        }
Beispiel #4
0
        /// <summary>
        /// 聯合國中介者
        /// </summary>
        public void ExcuteUnite()
        {
            UnitedNationsSecurityCouncil UNSC = new UnitedNationsSecurityCouncil();

            USA   c1 = new USA(UNSC);
            China c2 = new China(UNSC);

            UNSC.Colleague1 = c1;
            UNSC.Colleague2 = c2;

            c1.Declare("開打");
            c2.Declare("來啊");
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            China china = null;

            if (comboBox1.SelectedIndex == 0)
            {
                china = new China();
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                china = new AdapterAmerica();
            }
            china.Use();
        }
Beispiel #6
0
        static void InitialiseerLanden()
        {
            for (int i = 0; i < frmselecteren.LandHoeveelheid; i++)
            {
                int landID = Array.IndexOf(frmselecteren.isLand, true);
                switch (landID)
                {
                case 0:
                    Landen[i] = new Duitsland(i);
                    break;

                case 1:
                    Landen[i] = new USA(i);
                    break;

                case 2:
                    Landen[i] = new China(i);
                    break;

                case 3:
                    Landen[i] = new UK(i);
                    break;

                case 4:
                    Landen[i] = new Congo(i);
                    break;

                case 5:
                    Landen[i] = new Vietnam(i);
                    break;

                case 6:
                    Landen[i] = new Nigeria(i);
                    break;

                case 7:
                    Landen[i] = new Peru(i);
                    break;
                }
                frmselecteren.isLand[landID] = false;
            }
        }
Beispiel #7
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(China obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #8
0
 public China(China.Market m) : this(NQuantLibcPINVOKE.new_China__SWIG_0((int)m), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(China obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Beispiel #10
0
        public void PlaceObject()
        {
            Object temp;

            switch (ObjectListBox.SelectedItem.ToString())
            {
            case "Key":
                temp = new Key();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Ammo":
                temp = new Ammo();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Health":
                temp = new Health();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Adrenaline":
                temp = new Adrenaline();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Barrel":
                temp = new Barrel();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Pipe":
                temp = new Pipe();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Couch":
                temp = new Couch();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Wardrobe":
                temp = new Wardrobe();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Lamp":
                temp = new Lamp();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Desk":
                temp = new Desk();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Tree":
                temp = new Tree();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "China":
                temp = new China();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Table":
                temp = new Table();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Chair":
                temp = new Chair();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Pistol":
                temp = new Pistol();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Door":
                temp = new Door();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Assault Rifle":
                temp = new AssaultRifle();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Shotgun":
                temp = new Shotgun();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Rocket Launcher":
                temp = new RocketLauncher();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Laser Cannon":
                temp = new LaserCannon();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Player":
                temp = new Player();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Enemy":
                temp = new Enemy();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Civilian":
                temp = new Civilian();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Boss":
                temp = new Boss();
                PlacedObjectListBox.Items.Add(temp);
                break;

            case "Cop":
                temp = new Cop();
                PlacedObjectListBox.Items.Add(temp);
                break;
            }
            ;
        }
Beispiel #11
0
        private void reset()// reseta todos os pontos para proxima fase
        {
            saoPaulo      = new SaoPaulo();
            bahia         = new Bahia();
            caribe        = new Caribe();
            usa_leste     = new USA_Leste();
            usa_oeste     = new USA_Oeste();
            japao         = new Japao();
            china         = new China();
            tailandia     = new Tailandia();
            australia     = new Australia();
            unitedKingdom = new UnitedKingdom();
            africaCentral = new AfricaCentral();
            africaSul     = new AfricaSul();
            india         = new India();

            saoPaulo.getCondicao(true);
            bahia.getCondicao(true);
            caribe.getCondicao(true);
            usa_leste.getCondicao(true);
            usa_oeste.getCondicao(true);
            japao.getCondicao(true);
            china.getCondicao(true);
            tailandia.getCondicao(true);
            australia.getCondicao(true);
            unitedKingdom.getCondicao(true);
            africaCentral.getCondicao(true);
            africaSul.getCondicao(true);
            india.getCondicao(true);
            europaLeste.getCondicao(true);
            europaOeste.getCondicao(true);

            saoPaulo.getBloquedo(false);
            bahia.getBloquedo(false);
            caribe.getBloquedo(false);
            usa_leste.getBloquedo(false);
            usa_oeste.getBloquedo(false);
            japao.getBloquedo(false);
            china.getBloquedo(false);
            tailandia.getBloquedo(false);
            australia.getBloquedo(false);
            unitedKingdom.getBloquedo(false);
            africaCentral.getBloquedo(false);
            africaSul.getBloquedo(false);
            india.getBloquedo(false);
            europaLeste.getBloquedo(false);
            europaOeste.getBloquedo(false);

            saoPaulo.get_pct(pctSaoPaulo);
            bahia.get_pct(pctBahia);
            caribe.get_pct(pctCaribe);
            usa_leste.get_pct(pct_USA_Leste);
            usa_oeste.get_pct(pct_USA_Oeste);
            japao.get_pct(pctJapao);
            china.get_pct(pctChina);
            tailandia.get_pct(pctTailandia);
            australia.get_pct(pctAustralia);
            unitedKingdom.get_pct(pct_UnitedKingdom);
            africaCentral.get_pct(pctAfricaCenter);
            africaSul.get_pct(pctAfricaSul);
            india.get_pct(pctIndia);
            europaLeste.get_pct(pctEuropaLeste);
            europaOeste.get_pct(pctEuropaOeste);

            saoPaulo.mudarPonto();
            bahia.mudarPonto();
            caribe.mudarPonto();
            usa_leste.mudarPonto();
            usa_oeste.mudarPonto();
            japao.mudarPonto();
            china.mudarPonto();
            tailandia.mudarPonto();
            australia.mudarPonto();
            unitedKingdom.mudarPonto();
            africaCentral.mudarPonto();
            africaSul.mudarPonto();
            india.mudarPonto();
            europaOeste.mudarPonto();
            europaLeste.mudarPonto();
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            Console.Write("Как Вас зовут: ");
            string name = Console.ReadLine();

            Console.Write("Сколько у Вас средств: ");
            int balance = Int32.Parse(Console.ReadLine());

            Console.Write("Сколько Вы уже потратили в нашем магазине: ");
            int spent = Int32.Parse(Console.ReadLine());

            Console.WindowWidth = 63;
            User user = new User(name, balance, spent);

            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine("Список курсов: ");
            Console.ResetColor();

            English eng = new English(
                "В Ландон за 15 минут в день",
                "Королева Елизавета",
                "Английский",
                490,
                "Пирожок с подливой"
                );

            eng.InfoCourse(eng);

            Germany ger = new Germany(
                "На Берлин",
                "Рудольф Иванов",
                "Немецкий",
                666
                );

            ger.InfoCourse(ger);

            Italy itl = new Italy(
                "Хочу Пасту Болоньезе",
                "Равиолли Веспучи",
                "Итальянский",
                575
                );

            itl.InfoCourse(itl);

            China china = new China(
                "Последователь Мулан",
                "Хаоями Мияноки",
                "Китайский",
                1000
                );

            china.InfoCourse(china);

            Course[] courses = new Course[]
            {
                eng,
                ger,
                itl,
                china
            };
            Informer informer = new Informer();

            while (true)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("\nДобро пожаловать в мир почти бесплатных знаний!\n");
                Console.ResetColor();

                for (int i = 0; i < courses.Length; i++)
                {
                    Console.WriteLine($"Курс {i} - \"{courses[i].CourseName}\" по цене {courses[i].Price}");
                }
                Console.Write("\nВыбериет номер интересующего направления и нажмите Enter: ");
                int productNumber = Int32.Parse(Console.ReadLine());

                if (productNumber >= 0 && productNumber < courses.Length)
                {
                    if (courses[productNumber].Price <= user.Balance)
                    {
                        informer.Buy(user, courses[productNumber]);
                        Bye();
                    }
                    else
                    {
                        Console.WriteLine("У Вас недостаточно средств");
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Таких курсов у нас нет");
                    Console.ResetColor();
                }
            }