아카이브
스타크래프트 SCV 본문
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class TerranScv
{
enum eState
{
Move
}
int hp = 60;
int maxHp = 60;
int damage = 6;
int armor = 0;
eState state;
public TerranScv()
{
state = eState.Move;
Console.WriteLine("SCV가 생성되었습니다");
Console.WriteLine("체력: {0}/{1}", hp, maxHp);
Console.WriteLine("공격력:{0}", damage);
Console.WriteLine("방어력: {0}", armor);
}
public void Move()
{
if (state == eState.Move)
{
Console.WriteLine("SCV가 이동합니다.");
state = eState.Move;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class App
{
//생성자
public App()
{
TerranScv terranSCV = new TerranScv();
terranSCV.Move();
}
}
}