* After adding/removing tiles to station, update some station-related stuff. * @param adding True if adding tiles, false if removing them. * @param type StationType being modified. */
| 737 | * @param type StationType being modified. |
| 738 | */ |
| 739 | void Station::AfterStationTileSetChange(bool adding, StationType type) |
| 740 | { |
| 741 | this->UpdateVirtCoord(); |
| 742 | DirtyCompanyInfrastructureWindows(this->owner); |
| 743 | |
| 744 | if (adding) { |
| 745 | this->RecomputeCatchment(); |
| 746 | MarkCatchmentTilesDirty(); |
| 747 | InvalidateWindowData(WC_STATION_LIST, this->owner, 0); |
| 748 | } else { |
| 749 | MarkCatchmentTilesDirty(); |
| 750 | } |
| 751 | |
| 752 | switch (type) { |
| 753 | case StationType::Rail: |
| 754 | SetWindowWidgetDirty(WC_STATION_VIEW, this->index, WID_SV_TRAINS); |
| 755 | break; |
| 756 | case StationType::Airport: |
| 757 | break; |
| 758 | case StationType::Truck: |
| 759 | case StationType::Bus: |
| 760 | SetWindowWidgetDirty(WC_STATION_VIEW, this->index, WID_SV_ROADVEHS); |
| 761 | break; |
| 762 | case StationType::Dock: |
| 763 | SetWindowWidgetDirty(WC_STATION_VIEW, this->index, WID_SV_SHIPS); |
| 764 | break; |
| 765 | default: NOT_REACHED(); |
| 766 | } |
| 767 | |
| 768 | if (adding) { |
| 769 | UpdateStationAcceptance(this, false); |
| 770 | InvalidateWindowData(WC_SELECT_STATION, 0, 0); |
| 771 | } else { |
| 772 | DeleteStationIfEmpty(this); |
| 773 | this->RecomputeCatchment(); |
| 774 | } |
| 775 | |
| 776 | } |
| 777 | |
| 778 | CommandCost ClearTile_Station(TileIndex tile, DoCommandFlags flags); |
| 779 |
no test coverage detected