Exemple #1
0
        public void Commander_receive_infantry_ready()
        {
            var commander = new ConcreteMediator();                // 中介者

            var medic    = new MedicColleague("醫護兵", commander);   // 醫護兵
            var infantry = new InfantryColleague("戰士", commander); // 步兵

            infantry.Send("normal", "战士待命");
        }
Exemple #2
0
        public void MakeDrink_by_Recipe()
        {
            var commander = new ConcreteMediator();                // 中介者

            var medic    = new MedicColleague("醫護兵", commander);   // 醫護兵
            var infantry = new InfantryColleague("戰士", commander); // 步兵

            medic.Send("normal", "醫護兵待命");
            infantry.Send("normal", "战士待命");
            medic.Send("attack", "遭受敵人攻擊");
            infantry.Send("hurt", "我中彈了");
        }