using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study06
{
    class App
    {
        public App()
        {
            Hero hero = new Hero();
            Monster monster = new Monster();
            Coin coin = monster.Die();
            hero.Get(coin);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study06
{
    class Hero
    {
        public Hero()
        {

        }

        public void Get(Coin coin)
        {
            Console.WriteLine("{0}을 획득했습니다.", coin.name);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study06
{
    class Monster
    {
        public Monster()
        {

        }

        public Coin Die()
        {
            return new Coin ();
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study06
{
    class Coin
    {
        public string name = "코인";
        public Coin()
        {

        }
    }
}

+ Recent posts