Mercurial > hg > Members > kazuma > JungleforUnity
comparison Assets/Application/Scripts/Test/Functor.cs @ 13:e297afe0889d default tip
Add Prefab.
author | Kazuma Takeda |
---|---|
date | Tue, 07 Feb 2017 20:49:26 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
12:b55d586dd4eb | 13:e297afe0889d |
---|---|
1 using System.Collections.Generic; | |
2 | |
3 public class Functor { | |
4 | |
5 public static List<T> map<T> (System.Func<T, T> f, List<T> list) { | |
6 List<T> newList = new List<T> (); | |
7 foreach (var num in list) { | |
8 newList.Add (f (num)); | |
9 } | |
10 return newList; | |
11 } | |
12 } |