Esempio n. 1
0
        static void Main(string[] args)
        {
            Player NewPlayer = new Player();
            NPC    NewNPC    = new NPC();


            QuestUnit NewQuestUnit = NewNPC;

            //업캐스팅이 된다
            NewPlayer.Talk(NewNPC);
        }
Esempio n. 2
0
File: Program.cs Progetto: MomDra/CS
        static void Main(string[] args)
        {
            Player player = new Player();
            NPC    npc    = new NPC();

            QuestUnit qu1 = player;
            QuestUnit qu2 = npc;

            qu1.Talk(qu2);
            qu2.Talk(qu1);
            player.Talk(qu2);
            npc.Talk(qu1);
        }
Esempio n. 3
0
File: Program.cs Progetto: MomDra/CS
 // 인터페이스를 상속하면 인터페이스에 정의된 함수를 반드시 포함해야 함
 public void Talk(QuestUnit questUnit)
 {
     Console.WriteLine("NPC의 Talk!");
 }
Esempio n. 4
0
 public void Talk(QuestUnit _OtherUnit)
 {
 }