C# 141

2020.04.14. 과제 - 아이템 배열 값 빼기, 배열 정리하기(Inventory class, Item class)

1. App class 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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_009 { class App { public App() { //인벤토리 생성 Inventory inventory = new Inventory(); //아이템 생성 및 배열에 추가하는 메서드 ..

C#/과제 2020.04.14

2020.04.13. 수업내용 - SiegeTank 클래스(enum), Factory 클래스

1. App class 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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_008 { class App { public App() { Factory factory = new Factory(); SiegeTank tank = factory.CreateTank(); tank.Move(); tank.ChangeMode(); tank.Move(); } } } 2. Factory class 1 2 3 4 5 6 7 ..

C#/수업내용 2020.04.13

2020.04.10. 과제 - Character class, Item class

1. class App - 맨손일 땐 ("item",n)->(null,n) 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 class App { public App() { //홍길동 인스턴스 생성 Character hong = new Character("홍길동"); //임꺽정 인스턴스 생성 Character lim = new Character("임꺽정"); //아이템 제작 메서드 호출, return값을 변수에 저장함 Item item=hong.CreateItem("단검",4); //아이템 획득 메서드 호출 hong.GetItem(item); //아이템 착용 메서드 호출 hong.EquipItem(item); //아이템 해제 메서드..

C#/과제 2020.04.10

2020.04.09. 수업내용 - 요일 영어로 출력하기(enum,switch)

출력 명령어를 한번만 써서 출력하기 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 class App { enum eDay { None=-1, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } public App() { Console.WriteLine("2020-04-08\n"); //열거형으로 요일 입력받기 for(; ;) {..

C#/수업내용 2020.04.09

2020.04.09. 수업내용 - 아이템 확률적으로 강화하기(열거형, Switch)

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 115 116 117 118 119 120 121 122 123 124 125 126 12..

C#/수업내용 2020.04.09