示例#1
0
        static void Main(string[] args)
        {
            ConcreteMediator mediator = new ConcreteMediator();

            ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);
            ConcreteColleague2 colleague2 = new ConcreteColleague2(mediator);

            mediator.Colleague1 = colleague1;
            mediator.Colleague2 = colleague2;

            colleague1.Send("吃過飯了嗎?");
            colleague2.Send("沒有呢,你打算請客?");

            Console.WriteLine("");

            UnitedNationsSecurityCouncil UNSC = new UnitedNationsSecurityCouncil();

            USA  usa  = new USA(UNSC);
            Iraq iraq = new Iraq(UNSC);

            UNSC.Colleague1 = usa;
            UNSC.Colleague2 = iraq;

            usa.Delcare("不准研製核武器,否則要發動戰爭!");
            iraq.Declare("我們沒有核武器,也不怕侵略");

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            UNSCnitedationsecurityCouncil countcil = new UNSCnitedationsecurityCouncil();
            USA  usa  = new USA(countcil);
            Iraq iraq = new Iraq(countcil);

            countcil.colleague1 = usa;
            countcil.colleague2 = iraq;

            usa.Declare("不准研制核武器");
            iraq.Declare("不怕侵略");
        }
示例#3
0
        static void Main(string[] args)
        {
            UnitedNationsSecurityCouncil unsc = new UnitedNationsSecurityCouncil();
            USA  c1 = new USA(unsc);
            Iraq c2 = new Iraq(unsc);

            unsc.Colleague1 = c1;
            unsc.Colleague2 = c2;

            c1.Declare("不准研制核武器,否则要发动战争!");
            c2.Declare("我们没有核武器,也不怕侵略");

            Console.ReadKey();
        }
示例#4
0
        static void Main(string[] args)
        {
            UnitedNationsSecurityCouncil UNSC = new UnitedNationsSecurityCouncil();

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

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

            c1.Declare("不准研制核武器,否则发动战争!");
            c2.Declare("我们没有核武器,也不怕侵略。");

            Console.Read();
        }
        static void Main(string[] args)
        {
            unitedNationSecurityCouncil UNSC = new unitedNationSecurityCouncil();

            USA  USA  = new USA(UNSC);
            Iraq Iraq = new Iraq(UNSC);

            UNSC.country1 = USA;
            UNSC.country2 = Iraq;

            USA.Declare("呃呃呃");
            Iraq.Declare("呼呼呼");

            Console.Read();
        }
示例#6
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;

            UnitedNationSecurityCouncil UNSC = new UnitedNationSecurityCouncil();

            USA c1 = new USA(UNSC);

            Iraq c2 = new Iraq(UNSC);

            UNSC.Countey1 = c1;

            UNSC.Countey2 = c2;

            c1.Declare("再研制核武器打的萨达姆抬不起头");

            c2.Declare("谁怕谁,生死看淡,不服就干");

            Console.Read();
        }