C#/과제 18

2020.04.21. 과제 - json 파일 불러오기

오늘 배운 방법 외에 추가로 한가지 밖에 못 찾았습니다 json 파일로 변환할 item_data 엑셀 데이터 (homeEscape 게임 아이템) 1. File.ReadAllText(string path) 메서드로 읽어오기 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 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; ..

C#/과제 2020.04.21

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.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