Yang.공부방

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace GameEnums
{
    class GameEnum
    {
        public enum eCamp //진영
        {
            None,
            Alliance,
            Hord
        }
 
        public enum eTribe //(얼라이언스)부족
        {
            None,//0 
            Human,//1
            Dwarf,//2
            Nightelf,//3
            Gnomes,//4
            Draenei,//5
            Werewolf//6
        }
 
        public enum eTribe2 //(호드)부족2
        {
            None,//0
            Oak,//1
            Undead,//2
            Tauren,//3
            Troll,//4
            Bloodelves,//5
            Goblin//6
        }
 
        public enum job
        {
            DeathKnight, //죽음의기사
            Thief,//도적
            Hunter,//사냥꾼
            Monk,//수도사
            Wizard,//마법사
            Warlock,//흑마법사
            Priests,//사제
            Paladin,//성기사
            Warrior,//전사
 
            Powwow,//주술사
 
        }
    }
}
 
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace GameEnums
{
    class Character
    { public string name;
        private float x;
        private float y;
 
        public Character()
        {
        }
 
        public Character(string name)
        {
            this.name = name;
        }
 
        public void Move(float x, float y)
        {
 
            Console.WriteLine($"{name}님이 (x : {x} , y : {y}) 위치로 이동하였습니다.");
        }
    }
}
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
 
namespace GameEnums
{
    class App
    {
        public string AllianceList = "1.인간 2.드워프 3.나이트엘프 4.노움 5.드레나이 6.늑대인간";
        public string HordList = "1.오크 2.언데드 3.타우렌 4.트롤 5.블러드엘프 6.고블린";
 
        public App()
        {
            Console.WriteLine("진영을 선택해 주세요");
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "얼라이언스")
                {
                    Console.WriteLine("얼라이언스를 선택하셨습니다");
                    //Thread.Sleep(500);
                    Console.WriteLine("종족을 선택해주세요");
                    Console.WriteLine(AllianceList);
 
                    //foreach (var Values in Enum.GetValues(typeof(GameEnums.eTribe))){}
                    int intinput = Convert.ToInt16(Console.ReadLine());
                    if (intinput == 1)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Human}입니다.");
                        Console.WriteLine("직업을 선택해주세요");
 
                    }
                    else if (intinput == 2)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Dwarf}입니다.");
                    }
                    else if (intinput == 3)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Nightelf}입니다.");
                    }
                    else if (intinput == 4)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Gnomes}입니다.");
                    }
                    else if (intinput == 5)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Draenei}입니다.");
                    }
                    else if (intinput == 6)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe.Werewolf}입니다.");
                    }
                    else if (intinput == 0)
                    {
                        break;
                    }
 
                }
                else if (input == "호드")
                {
                    Console.WriteLine("호드를 선택하셨습니다");
                    //Thread.Sleep(500);
                    Console.WriteLine("종족을 선택해주세요");
                    int intinput = Convert.ToInt16(Console.ReadLine());
                    if (intinput == 1)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Oak}입니다.");
                    }
                    else if (intinput == 2)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Undead}입니다.");
                    }
                    else if (intinput == 3)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Tauren}입니다.");
                    }
                    else if (intinput == 4)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Troll}입니다.");
                    }
                    else if (intinput == 5)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Bloodelves}입니다.");
                    }
                    else if (intinput == 6)
                    {
                        Console.WriteLine($"고르신 종족은 {GameEnum.eTribe2.Goblin}입니다.");
                    }
                    else if (intinput == 0)
                    {
                        break;
                    }
                }
                else if (input != "얼라이언스" || input == "호드")
                {
                    Console.WriteLine("잘못 입력하셨습니다");
                    Thread.Sleep(1000);
                    Console.WriteLine("프로그램을 종료합니다");
                    break;
                }
 
            }
            /*
            Console.WriteLine("캐릭터의 이름을 선택하여 주세요");
            var character = new Character(Console.ReadLine());
            Console.WriteLine("캐릭터의 이름은 {0}입니다", character.name);
            character.Move(3f , 5f);
            */
        }
    }
}
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace GameEnums
{
    class Program
    {
        static void Main(string[] args)
        {
            new App();
        }
    }
}
 
cs