using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace hello_world
{
class Program
{
enum STATE
{
Idle = 100,
Walk = 200,
Run,
Attack,
Hit,
Die
}
static void Main(string[] args)
{
//변수의 정의
//변수타입 변수명
STATE state;
//변수에 값을 할당
state = STATE.Idle;
Console.WriteLine("state: {0}", state);
//열거형식을 정수로 변환
int a = Convert.ToInt32(state);
Console.WriteLine("a: {0}", a);
//정수를 열거형식으로 변환
STATE state2 = (STATE)200;
Console.WriteLine("state2: {0}", state2);
//없는 상수라면 정수로 나온다
STATE state3 = (STATE)500;
Console.WriteLine("state3: {0}", state3);
}
}
}