using System;
using System.Collections.Generic;
using System.Text;
namespace Study03
{
class App
{
public App()
{
Mushroom mushroom = new Mushroom();
mushroom.Move();
mushroom.Attack();
mushroom.Hit();
mushroom.Die();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Study03
{
class Mushroom
{
//멤버변수
int level = 10;
int hp = 125;
int mp = 10;
int exp = 17;
//생성자
public Mushroom()
{
Console.WriteLine("주황버섯이 생성되었습니다");
}
//멤버메서드
public void Move()
{
Console.WriteLine("주황버섯이 이동합니다");
}
public void Attack()
{
Console.WriteLine("주황버섯이 공격합니다");
}
public void Hit()
{
Console.WriteLine("주황버섯이 공격당했습니다");
}
public void Die()
{
Console.WriteLine("주황버섯이 죽었습니다");
}
}
}