static void Main(string[] args) { SchoolGirl jiaojiao = new SchoolGirl(); jiaojiao.Name = "李嬌嬌"; Pursuit zhuojiayi = new Pursuit(jiaojiao); zhuojiayi.GiveDolls(); zhuojiayi.GiveFlowers(); zhuojiayi.GiveChocolate(); Console.Read(); }
private static void Main(string[] args) { SchoolGirl jiaojiao = new SchoolGirl(); jiaojiao.Name = "李娇娇"; Pursuit zhuojiayi = new Pursuit(jiaojiao); zhuojiayi.GiveDolls(); zhuojiayi.GiveFlowers(); zhuojiayi.GiveChocolate(); Console.Read(); }
static void Main(string[] args) { //创建被追求者 SchoolGirl girl = new SchoolGirl("芳芳"); //创建追求者 Pursuit pursuit = new Pursuit(girl); //创建代理追求者 Proxy proxy = new Proxy(girl); //代理者执行的是追求者里的方法 proxy.GiveChocolate(); proxy.GiveDolls(); proxy.GiveFlowers(); Console.ReadKey(); }
public Proxy(SchoolGirl mm) { gg = new Pursuit(mm); }
public Agent(Beauty mm) { ps = new Pursuit(mm); }
public Proxy(SchoolGirl girl) { _pursuit = new Pursuit(girl); }
public Proxy(Pursuit pursuit) { mPursuit = pursuit; }