목록전체 글 (64)
아카이브

Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LearnJson { internal class Program { static void Main(string[] args) { //new키워드: App클래스의 인스턴스 생성하고 생성자 호출 new App(); } } } App.cs using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using..
program.cs using System; namespace LearnDotnet { internal class Program { static void Main(string[] args) { //new키워드: App클래스의 인스턴스 생성하고 생성자 호출 new App(); } } } App.cs using System; using System.IO; using Newtonsoft.Json; using System.Collections.Generic; using System.Linq; namespace LearnDotnet { public class App { private Game game; //생성자 public App() { DataManager.instance.LoadItemDatas(); Dat..

Hero.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LearnDotnet { public class Hero { public int hp; public int maxHp; //생성자 public Hero() { this.hp = 30; this.maxHp = this.hp; } //남은체력 public void HitDamage(int damage, Action callback) { this.hp -= damage; Console.WriteLine("공격받았습니다. {0}만큼 hp가 깎입니다.",damage); call..

1. 히어로 클래스 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LearnDotnet { public class Hero { public Hero() { Console.WriteLine("영웅이 생성되었습니다."); } public void Move(Action callback) { Console.WriteLine("이동중..."); Console.WriteLine("이동중..."); Console.WriteLine("이동완료"); callback(); } } } 앱 using LearnDotnet; using System; ..