C#
-
퀘스트 생성 및 진행C#/수업내용 2022. 6. 22. 18:03
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Review10 { public class Game { public Game() { this.LoadDatas(); Character user = new Character(); user.AcceptQuest(1001); user.AcceptQuest(1002); user.AcceptQuest(1003); user.PrintAcceptedQuest(); user.onUpdateQuestEventHandler += (sender, args) => { Quest.instance.Updat..
-
텍스트 Rpg만들기C#/수업과제 2022. 6. 21. 18:00
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using System.IO; namespace Study09 { public class Game { private Character user; public Game() { this.LoadDatas(); if (this.IsNewbie()) { this.CreateCharacter(); } else { Character character = new Character(this.LoadCharacterInfo()); user = character; } user...
-
몬스터 잡고 아이템 드랍 저장, 싱글톤 데이터매니저C#/수업내용 2022. 6. 20. 14:45
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Newtonsoft.Json; namespace Study08 { public class Game { //필드 public List monsters; private Inventory inven; public Game() { this.monsters = new List(); this.LoadDatas(); this.inven = new Inventory(); } private void LoadDatas() { DataManager.instance.LoadMons..
-
데이터 저장 연습과제C#/수업과제 2022. 6. 20. 02:38
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Newtonsoft.Json; namespace Homework { public class App { public Dictionary DicItem; //생성자 public App() { string item_json = File.ReadAllText("./item_data.json"); ItemData[] arrItemDatas = JsonConvert.DeserializeObject(item_json); Dictionary dicItem = arrItemD..
-
대리자, 람다식, 익명함수 이해C#/수업내용 2022. 6. 16. 17:58
using System; using System.Collections; namespace Study06 { public class App { public App() { Hero hero = new Hero(); hero.Move(() => { Console.WriteLine("move complete!"); }); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class Hero { public Hero() { } public void Move(Action callback) { //이동코..
-
2차원 배열의 늑대와 영웅C#/수업과제 2022. 6. 15. 18:01
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study05 { public class App { //생산자 public App() { new Game(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study05 { public class Game { public Game() { Map map = new Map(); map.ReadMap..
-
2048게임C#/수업과제 2022. 6. 15. 13:22
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _2048Game_practice { internal class App { public App() { Game game = new Game(); game.Start(); game.Print(); game.StartMoveLeft(); game.Print(); game.AddNum(); game.Print(); Console.WriteLine(); game.StartMoveLeft(); game.Print(); game.AddNum(); game.Print(); Console.Writ..
-
인벤토리 만들기C#/수업내용 2022. 6. 14. 14:08
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study04 { public class App { //생성자 public App() { //Inventory 클래스의 인스턴스가 생성되고 변수 inven에 할당 //Inventory 클래스의 생성자 호출 Inventory inven = new Inventory(3); //Item 클래스의 인스턴스가 생성되고 변수 item1에 할당 //Item 클래스의 생성자 호출 //인스턴스 item1의 Name 속성에 "장검"할당 Item item1 = new Item("장검"); //인스턴스i..