예제 #1
0
        static void Main(string[] args)
        {
            Cat cat = new Cat("kafei" ,"yellow");
            Mouse mouse1 = new Mouse("miki","white",cat);
            //cat.catCome += mouse1.RunAway;

            Mouse mouse2 = new Mouse("kili","black",cat);
            //cat.catCome += mouse2.RunAway;
            //cat.CatComing(mouse1,mouse2);

            cat.CatComing();

            Console.ReadKey();
        }
예제 #2
0
파일: Mouse.cs 프로젝트: vin120/c-shap-code
 public Mouse(string name, string color,Cat cat)
 {
     this.name = name;
     this.color = color;
     cat.catCome += this.RunAway;
 }