Пример #1
0
        internal RoadStationInfo EnsureStation(TownNode townNode)
        {
            if (this.stations.ContainsKey(townNode.TownId))
            {
                return(this.stations[townNode.TownId]);
            }

            var place = RoadStationBuilder.FindPlaceForStation(townNode.Location.Tile);

            AIRoad.BuildRoadStation(place.tile, place.entryPoint, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_NEW);
            AIRoad.BuildRoad(place.tile, place.entryPoint);
            this.stations.Add(townNode.TownId, place);
            return(place);
        }
Пример #2
0
        internal RoadStationInfo EnsureDepot(TownNode townNode)
        {
            if (this.depots.ContainsKey(townNode.TownId))
            {
                return(this.depots[townNode.TownId]);
            }

            var place = RoadStationBuilder.FindPlaceForStation(townNode.Location.Tile);

            if (place != null)
            {
                AIRoad.BuildRoadDepot(place.tile, place.entryPoint);
                AIRoad.BuildRoad(place.tile, place.entryPoint);
                this.depots.Add(townNode.TownId, place);
                return(place);
            }
            else
            {
                return(null);
            }
        }