ctac.MapService.CheckNeighbors C# (CSharp) Method

CheckNeighbors() private method

private CheckNeighbors ( Vector2 toCheck ) : Tile>.Dictionary
toCheck Vector2
return Tile>.Dictionary
        private Dictionary<Vector2, Tile> CheckNeighbors(Vector2[] toCheck)
        {
            var ret = new Dictionary<Vector2, Tile>();
            Tile next = null;

            foreach (var currentDirection in toCheck)
            {
                //check it's not off the map
                next = mapModel.tiles.Get(currentDirection);
                if (next != null)
                {
                    ret.Add(currentDirection, next);
                }
            }
            return ret;
        }