using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class HornyMushroom
{
public int hp;
public int exp;
//생성자
public HornyMushroom()
{
}
public void Attack()
{
Console.WriteLine("뿔버섯이 공격했습니다.");
}
public void GiveItem()
{
Console.WriteLine("아이템을 주었습니다.");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class App
{
//생성자
public App()
{
HornyMushroom hornyMushroom = new HornyMushroom();
hornyMushroom.hp = 175;
hornyMushroom.exp = 21;
Console.WriteLine("체력: {0}", hornyMushroom.hp);
Console.WriteLine("경험치: {0}", hornyMushroom.exp);
hornyMushroom.Attack();
hornyMushroom.GiveItem();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class Program
{
static void Main(string[] args)
{
new App();
}
}
}