Hyluss icon

foreach where example

Hyluss | PRO | 01/26/20 12:13:32 AM UTC | 0 ⭐ | 539 👁️ | Never ⏰ | []
C# |

410 B

|

None

|

0 👍

/

0 👎

  public static DIRECTIONS[] IntersectDirections(Hexagon[] hexagons)
    {
        List<DIRECTIONS> tempList = new List<DIRECTIONS>();
        foreach (var h in hexagons)
        {
            foreach (var direction in h.Connections.Where(direction => !tempList.Contains(direction)))
            {
                tempList.Add(direction);
            }
        }
 
        return tempList.ToArray();
    }

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎