일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- nav거리
- unity 병합
- 깃허브 데스크탑 병합
- 오브젝트 깜빡임
- navigation
- 몬스터
- m590 수리
- unity merge
- 유니티 해상도 설정
- networkobject.networkid
- unity git
- 유니티
- Unity
- M590
- networkbehaviourid
- githubdesktopmerge
- 유니티 해상도
- nav오브젝트사이거리
- networkobject
- 유니티 브랜치 merge
- 유니티 머지
- 깃허브 데스크탑 합치기
- NavMesh
- stateauthority
- 유니티 해상도 변경
- m585 수리
- Github DeskTop Merge
- 유니티 합치기
- m585
- Today
- Total
목록기타/C# (11)
집게사장의 꿈

구조체에 대한 Operator를 만들고 싶다면?아쉽게도, 직접적인 + - 와 같은 연산자 오퍼레이터는 사용할 수 없다그럼 방법은?public하고 static한 "확장자"를 사용하는 것이다.하지만, 이것도 되는 경우와 안되는 경우가 있다.예를 들어 BigInteger라는 구조체가 있다고 해보자안되는 경우this BigIntegerthis를 통한 단순한 값에 대한 복사는 직접적인 참조가 불가능 해 실제 값은 변경할 수 없다. using UnityEngine;using System.Numerics;public class Testing : MonoBehaviour{ private void Update() { if (Input.GetKeyDown(KeyCode.Space)) {..

기존 완전탐색으로 진행하였으나.. 메모리 초과최대 400만 바이트의 사용이 가능하기에, 모든 경우의 수를 배열에 저장하면 안된다... 접근주어진 배열에서 최대[최소] 값을 선택하는 과정선택은 현재 배열이 아닌 다음으로 입력된 배열이 기존에 있는 최적의 값에서 선택하는 것 입력된 순서대로 현재 배열[0]에서 다음 배열[1]의 값을 선택했을 경우에는저장된 배열의 위치[0]에서 다음 수를 선택할 수 없는[2] 오류가 발생했다.코드internal class E1916_내려가기{ static void Main(string[] args) { string[] input(StreamReader s) => s.ReadLine().Split(); using (StreamReader s..

C#에서는 음수를 표현할 때 2의 보수로 나타난다. 그렇다면 왜 그럴까?그건! 보수로 표현하면 덧셈 뺄셈 연산이 편리하기 때문! 예시로 8비트의 정수가 있다고 보자. 이 정수는 4와 -4를 표현한다. 실제 결과값으로 보면 N의 음수값은 N의 2의 보수값으로 표현된다. 추가-N의 값에 ~연산자를 통해 반전을 준다면,N-1의 양수 값이 나온다. 1의 보수2의 보수-4[1100][3]0011[4]0100 List.BinarySearch

시퀀스 요소의 오름차순 정렬Orderbypublic static System.Linq.IOrderedEnumerable OrderBy (this System.Collections.Generic.IEnumerable source, Func keySelector);반환IOrderedEnumerable요소가 키에 따라 정렬된 IOrderedEnumerable입니다.예외ArgumentNullException source 또는 keySelector가 null인 경우Func keySelectorTSource에서 오름차순을 위한 기준 값은 반환하는 대리자 *나이를 기준으로 오름차순 정렬class Pet{ public string Name { get; set; } public int Age { get; se..

시퀀스 요소의 IEnumerable 요소를 새로운 형식으로 평면화public static System.Collections.Generic.IEnumerable SelectMany (this System.Collections.Generic.IEnumerable source, Func> collectionSelector, Func resultSelector);반환IEnumerable해당 요소가 입력 시퀀스의 각 요소에 대해 일대다 변형 함수를 호출한 결과인 IEnumerable입니다.예외ArgumentNullException source 또는 selector가 null인 경우 this System.Collections.Generic.IEnumerable source참조할 시퀀스 데이터Func> collect..

두 시퀀스의 교집합을 구하는Intersectpublic static System.Collections.Generic.IEnumerable Intersect (this System.Collections.Generic.IEnumerable first, System.Collections.Generic.IEnumerable second);반환IEnumerable 두 시퀀스의 교집합을 이루는 요소가 들어 있는 시퀀스입니다.예외ArgumentNullExceptionfirst 또는 second가 null인 경우 int[] id1 = { 44, 26, 92, 30, 71, 38 };int[] id2 = { 39, 59, 83, 47, 26, 4, 30 };IEnumerable both = id1.Intersect(id..

MAX 최대값을 반환하는MIN 최소값을 반환하는SUM 모든 요소를 더한COUNT 요소의 개수를 세아린AVERAGE 요소들의 평균을 내는CONTAINS 요소에 어떤 요소가 포함되었는지 판단하는ALL 원하는 조건에 모든 요소가 해당하는지ANY 원하는 조건이 하나의 요소라도 해당하는지AGGREGATE 값을 누적하는시퀀스 요소 중 최대값을 반환하는 MAX 기본List longs = new List { 4294967296L, 466855135L, 81125L };long max = longs.Max();Console.WriteLine("The largest number is {0}.", max);/* This code produces the following output: The largest number is ..

지정한 키값을 기준으로 지정된 요소를 분류하는 함수GroupBy 1. 키 선택기를 이용해 시퀀스 요소를 그룹화 하고 그룹 내 요소는 지정된 함수를 통해 형식을 지정한다.public static System.Collections.Generic.IEnumerable GroupBy (this System.Collections.Generic.IEnumerable source, Func keySelector, Func elementSelector, Func,TResult> resultSelector);반환IEnumerable각 요소가 그룹과 해당 키에 대한 프로젝션을 나타내는 TResult 형식의 요소 컬렉션입니다.예외ArgumentNullExceptionsource, keySelector, elementSe..

목차AppendCastConcatRepeatReverseRangeDefaultIfEmptyFirstOrDefaultJoin 시퀀스의 끝에 값을 추가하는Appendpublic static System.Collections.Generic.IEnumerable Append (this System.Collections.Generic.IEnumerable source, TSource element);source : 참조할 값의 시퀀스element : sources에 추가할 값반환 : element로 끝나는 새로운 시퀀스예외ArgumentNullExceptionsource이(가) null인 경우 // 기존 List 에 N 숫자를 붙여서 새로운 시퀀스로 반환// Creating a list of numbersL..

https://learn.microsoft.com/ko-kr/dotnet/csharp/language-reference/keywords/query-keywordsFrom"데이터 소스 참조할 변수를 지정하는 것" 기본var lowNums = from num in numbers where num num : int 타입 참조받을 데이터numbers : 참조할 데이터 컬렉션 복합 From List students = [ new Student {LastName="Omelchenko", Scores= [97, 72, 81, 60]}, new Student {LastName="O'Donnell", Scores= [75, 84, 91, 39]},..