Пример #1
0
        public static Cell FromCoordinateSet(Coordinate coordinate, HashSet <Coordinate> newDictSet)
        {
            var cell = new Cell(coordinate);

            foreach (var direction in Enum.GetValues <Direction>())
            {
                var proposedNeighbour = coordinate.GetOffsetCoordinate(direction);

                if (newDictSet.Contains(proposedNeighbour))
                {
                    cell.SetNeighbour(direction);
                }
            }

            return(cell);
        }