C#/수업내용
-
03/22 델리게이트 연습 6C#/수업내용 2021. 3. 22. 16:10
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Building b = new Building(); b.onBuildComplete = OnBuildComplete; this.Build(b); } private void Build(Building b) { b.StartBuildProcess(); } private void OnBuildComplete() { C..
-
03/22 델리게이트 연습 5C#/수업내용 2021. 3. 22. 12:30
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); GameLauncher launcher = new GameLauncher(); launcher.onEndGame = this.OnEndGame; launcher.StartGame(); } private void OnEndGame() { Console.WriteLine..
-
03/22 델리게이트 연습 4C#/수업내용 2021. 3. 22. 12:17
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); SceneManager sm = new SceneManager(); //델리게이트 인스턴스화 sm.onLoaded = this.OnLoaded; //메서드 호출 sm.LoadScene("Lobby"); } //델리게이트 메서드 정의 private void OnLoad..
-
03/22 델리게이트 연습 3C#/수업내용 2021. 3. 22. 12:11
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); FileManager fm = new FileManager(); fm.onOpenComple = this.OnOpenComplete; fm.Open("C:\\test.txt"); } private void OnOpenComplete() { Console.WriteLi..
-
03/22 델리게이트 연습 2C#/수업내용 2021. 3. 22. 12:01
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); Building building = new Building(); //델리게이트 인스턴스화 building.onComplete = this.OnComplete; //빌드 시작 building.Build(); } private void OnComplete() { Cons..
-
03/22 델리게이트 연습 1C#/수업내용 2021. 3. 22. 11:54
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); Button btn = new Button(); //버튼을 눌렀다면 알려줘 btn.onClick = this.OnClickButton; //유저가 버튼을 눌렀다 btn.Click(); } public void OnClickButton() { //설정 팝업을 연다 Co..
-
03/19 수업내용 메모C#/수업내용 2021. 3. 19. 18:18
2021/03/19 튜플 여러 데이터 요소를 그룹화, 값 형식 (int, string) info = (100, "장검"); 분할 클래스(Partial) 둘 이상의 소스파일에 분할 할 수 있음, 코드가 길어질 경우에 사용 대규모 프로젝트에서 작업하는 경우 개별 파일에 분산하면 여러 프로그래머가 동시에 클래스에 대해 작업 가능 명명규칙 : class+기능 확장명 메서드(Extension Method) 기존 형식에 메서드를 추가할 수 있음, 매개변수 앞에 this 한정자가 있음 String.Split메서드 static 형식 자체에 속하는 정적 멤버를 선언, 프로그램 종료시까지 계속 존재 예외처리 예외를 회피하기 위함이 아닌 예측하고 대처하기 위해 사용 throw 예외를 발생시킴String.Split메서드
-
03/19 1차원 2048게임 구현C#/수업내용 2021. 3. 19. 17:06
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..