using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class OrangeMushroom
{
public int hp;
public int exp;
//생성자
public OrangeMushroom()
{
}
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()
{
OrangeMushroom orangeMushroom = new OrangeMushroom();
orangeMushroom.hp = 175;
orangeMushroom.exp = 17;
Console.WriteLine("체력: {0}",orangeMushroom.hp);
Console.WriteLine("경험치: {0}",orangeMushroom.exp);
orangeMushroom.Attack();
orangeMushroom.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();
}
}
}