Hyluss

foreach where example

Jan 25th, 2020
610
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1.   public static DIRECTIONS[] IntersectDirections(Hexagon[] hexagons)
  2.     {
  3.         List<DIRECTIONS> tempList = new List<DIRECTIONS>();
  4.         foreach (var h in hexagons)
  5.         {
  6.             foreach (var direction in h.Connections.Where(direction => !tempList.Contains(direction)))
  7.             {
  8.                 tempList.Add(direction);
  9.             }
  10.         }
  11.  
  12.         return tempList.ToArray();
  13.     }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment