static void Main(string[] args) { UnitedNationsSecurityConcil UNSC = new UnitedNationsSecurityConcil(); USA c1 = new USA(UNSC); Iraq c2 = new Iraq(UNSC); UNSC.Colleague1 = c1; UNSC.Colleague2 = c2; c1.Declare("不准研制核武器,否则我发动战争"); c2.Declare("我们没有核武器,也不怕侵略"); }
static void Main(string[] args) { Council united = new Council(); USA usa = new USA(united); Iraq iraq = new Iraq(united); united.Country1 = usa; united.Country2 = iraq; usa.Declare("不准研制核武器!"); iraq.Declare("你打我呀!"); Console.Read(); }
static void Main(string[] args) { //申明联合国安全组织 UnitedNationSecurity security = new UnitedNationSecurity(); //申明国家 USA usa = new USA(security); Iraq iraq = new Iraq(security); //指定好国家 security.iraq = iraq; security.usa = usa; //宣布 usa.Declare("你有核武器 我们要发动战争"); iraq.Declare("我们没有核武器,不怕被侵略"); Console.ReadKey(); }