C#(25)
-
레시피 관리 및 요리하기
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_011 { class Recipe { public string name; // 레시피 이름 public string[] arrFoodIngredientNames; // 레시피 재료 목록 public Recipe(string name, string[] arrFoodIngredientNames) { this.name = name; this.arrFoodIngr..
2020.04.20 -
배열의 복사(Deep/Shallow)
1. 배열을 대입 형태로 복사 : Deep Copy 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_010 { class App { public App() { int[] a = new int[5]; int[] b = new int[3]; for (int i = 0; i
2020.04.16 -
인벤토리
1) 인벤토리 정리 - CleanUp() 메소드 2) 인벤토리에서 아이템 추출 - GetItem() 메소드 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 using System; using System.Collections.Generic; using System.L..
2020.04.14 -
스타크래프트 - 배럭
1) 배럭 기능 구현 a) 유닛 생산 : 클래스로 구현 및 관리 - 유닛 생산 조건 : TechnicalTree 클래스를 이용하여 Static 변수로 조건 개별 관리 -> 플레이어마다 단 하나의 트리만 있으면 됨. 또한 모든 클래스에서 조건을 확인하기 때문에 어디서든 접근이 용이해야함. b) 자체 기능 : 메소드로 구현 - 유닛 생산 조건에 따른 종족 테크트리 조건을 정리해놓은 클래스 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 6..
2020.04.14 -
인벤토리에 아이템 넣기
1) 배열 내의 요소가 null일 가능성을 항상 염두에 두고 조건을 걸어놓자. - 예외 발생 방지 2) foreach - 배열 전용 반복문인 듯 하다. 요소를 차례로 최대치까지 맞춰서 꺼내주기 때문에 정적 배열에서의 영역 오접근을 막기 편하다. 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 using System; using System.Collections.Generic; using System.Linq;..
2020.04.14 -
캐릭터간 대전
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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_007 { class App { public App() { Character hong = new Character("홍길동..
2020.04.10