Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 재귀
- C#
- DP
- parameter
- Material
- 시작해요 언리얼 2022
- guide
- c++
- Class
- W3Schools
- loop
- github
- UE5
- 백준
- Unreal Engine 5
- dynamic
- Algorithm
- w3school
- 파이썬
- 문제풀이
- python
- Basic
- 오류
- Tutorial
- Programming
- String
- 프로그래밍
- 기초
- dfs
- Unity
Archives
- Today
- Total
행복한 개구리
C# 21.03.25.복습 본문
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Homework1234
{
class App
{
public App()
{
Console.WriteLine("App");
ItemData data = new ItemData(1, "천 옷", eGrade.Rare);
Item item = new Item(data);
User user = new User();
user.StartCrafting(item);
user.completeCrafting();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Homework1234
{
public enum eGrade
{
Normal, Rare, Unique, Legendary
}
public class ItemData
{
public int id;
public string name;
public eGrade grade;
public ItemData(int id, string name, eGrade grade)
{
this.id = id;
this.name = name;
this.grade = grade;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Homework1234
{
public class Item
{
public ItemData data;
public Item(ItemData data)
{
this.data = data;
}
public void CompleteCrafting()
{
Console.WriteLine("제작이 완료되었습니다.");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Homework1234
{
public delegate void DelCompleteCrafting();
public class User
{
public DelCompleteCrafting completeCrafting;
public void StartCrafting(Item item)
{
Console.WriteLine("{0}을 만듭니다. ID : {1} / 등급 : {2}", item.data.name, item.data.id,item.data.grade);
for (int i = 0; i < 10; i++)
{
Console.WriteLine("제작중..... {0}%", i * 10);
Thread.Sleep(500);
}
this.completeCrafting = item.CompleteCrafting;
}
}
}
ㅎ
'C# > 복습' 카테고리의 다른 글
C# 21.04.05.복습 (0) | 2021.04.05 |
---|---|
C#21.03.29.복습 (0) | 2021.03.29 |
C#21.03.26~28.복습 (0) | 2021.03.26 |
C# 21.03.23.복습 (0) | 2021.03.23 |