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();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class App
{
//생성자
public App()
{
Zealot zealot = new Zealot();
zealot.hp = 100;
zealot.moveSpeed = 1.875f;
Console.WriteLine("생명력: {0}", zealot.hp);
Console.WriteLine("이동속도: {0}", zealot.moveSpeed);
zealot.Attack();
zealot.Die();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study02
{
internal class Zealot
{
public int hp;
public float moveSpeed;
//생성자
public Zealot()
{
}
public void Attack()
{
Console.WriteLine("질럿이 공격했습니다.");
}
public void Die()
{
Console.WriteLine("질럿이 죽었습니다.");
}
}
}