Example #1
0
    public bool AddBridge(int x, int y)
    {
        Coordinate coord   = new Coordinate(x, y);
        bool       created = false;

        foreach (var elem in grid)
        {
            if (coord.Compare(elem.Key.x, elem.Key.y))
            {
                if (elem.Value != GridSpaceStatus.E)
                {
                    break;
                }
                else
                {
                    grid[coord] = GridSpaceStatus.E;
                    created     = true;
                    break;
                }
            }
        }
        return(created);
    }