System.Collections.Generic.IEnumerable.Contains(Vector3Int)

Here are the examples of the csharp api System.Collections.Generic.IEnumerable.Contains(Vector3Int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : HexGridCornersProvider.cs
with MIT License
from AurelWu

public static List<Vector3Int> TileBorders(IEnumerable<Vector3Int> tiles)
            {
                List<Vector3Int> corners = new List<Vector3Int>();
                Dictionary<Vector3Int, int> numberOfAdjacentTilesByCorner = new Dictionary<Vector3Int, int>();

                foreach (var tile in tiles)
                {
                    List<Vector3Int> cornerCoordsOfCell = GetCorners.OfTile(tile);
                    foreach (var c in cornerCoordsOfCell)
                    {
                        if (numberOfAdjacentTilesByCorner.Keys.Contains(c)) numberOfAdjacentTilesByCorner[c] += 1;
                        else numberOfAdjacentTilesByCorner.Add(c,1); ;
                    }
                }

                foreach(var kvp in numberOfAdjacentTilesByCorner)
                {
                    if(kvp.Value < 3)
                    {
                        corners.Add(kvp.Key);
                    }
                }

                return corners;
            }