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..
-
몬스터 잡고 아이템 드랍 저장, 싱글톤 데이터매니저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. 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) { //이동코..
-
인벤토리 만들기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..
-
늑대 미니게임C#/수업내용 2022. 6. 10. 15:49
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study02 { internal class Program { static void Main(string[] args) { //당신의 이름은 무엇입니까? Console.WriteLine("당신의 이름은 무엇입니까?"); string name = Console.ReadLine(); //당신의 공격력은 몇입니까? (1~5) : Console.WriteLine("당신의 공격력은 몇입니까?(1~5)"); string damage = Console.ReadLine(); int damageNu..