Mercurial > hg > Members > kazuma > JungleforUnity
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Assets/Application/Scripts/Test/Functor.cs Tue Feb 07 20:49:26 2017 +0900 @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +public class Functor { + + public static List<T> map<T> (System.Func<T, T> f, List<T> list) { + List<T> newList = new List<T> (); + foreach (var num in list) { + newList.Add (f (num)); + } + return newList; + } +}