public void TryLocate(
            IBuilding building,
            IPoint placingPointOnMap)
        {
            var canLocate = _buildingOnMapLocator.CanLocate(_map, building, placingPointOnMap);

            if (canLocate)
            {
                var pathToNearestStreet = _pathToNearestStreetFromBuildingFinder.Find(building, placingPointOnMap);

                if (pathToNearestStreet != null)
                {
                    _buildingOnMapLocator.Locate(_map, building, placingPointOnMap);

                    foreach (var tile in pathToNearestStreet)
                    {
                        tile.TileState = TileState.Street;
                    }
                }
            }
        }
Example #2
0
 public virtual void PlaceBuildingOn(IMap map, IBuilding building, Point placingPointOnMap, Angle angle)
 {
     _buildingOnMapLocator.Locate(map, building, placingPointOnMap);
 }