using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class CokeMushroom
{
public int hp;
public int exp;
//생성자
public CokeMushroom()
{
}
public void Attack()
{
Console.WriteLine("코크버섯이 공격했습니다.");
}
public void GiveMeso()
{
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()
{
CokeMushroom cokeMushroom = new CokeMushroom();
cokeMushroom.hp = 375;
cokeMushroom.exp = 35;
Console.WriteLine("체력: {0}", cokeMushroom.hp);
Console.WriteLine("경험치: {0}", cokeMushroom.exp);
cokeMushroom.Attack();
cokeMushroom.GiveMeso();
}
}
}
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();
}
}
}