Automatic train stations (#1353)

## Description:

Train stations are now built automatically when a factory is
constructed.

Changes:
- When a factory is built, nearby structures are connected to the rail
network
- When a city is built near a factory, it is connected to the rail
network
    - All structures behave the same when a train stops: to be defined
    - Removed station badge
    - Gold income is now related to the structure's level

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
This commit is contained in:
DevelopingTom
2025-07-06 13:15:49 -07:00
committed by GitHub
parent 3108921637
commit 6353a5d6f7
23 changed files with 105 additions and 185 deletions
-17
View File
@@ -54,10 +54,6 @@ export class SendUpgradeStructureIntentEvent implements GameEvent {
) {}
}
export class SendCreateTrainStationIntentEvent implements GameEvent {
constructor(public readonly unitId: number) {}
}
export class SendAllianceReplyIntentEvent implements GameEvent {
constructor(
// The original alliance requestor
@@ -211,9 +207,6 @@ export class Transport {
this.eventBus.on(SendUpgradeStructureIntentEvent, (e) =>
this.onSendUpgradeStructureIntent(e),
);
this.eventBus.on(SendCreateTrainStationIntentEvent, (e) =>
this.onSendCreateTrainStationIntent(e),
);
this.eventBus.on(SendBoatAttackIntentEvent, (e) =>
this.onSendBoatAttackIntent(e),
);
@@ -478,16 +471,6 @@ export class Transport {
});
}
private onSendCreateTrainStationIntent(
event: SendCreateTrainStationIntentEvent,
) {
this.sendIntent({
type: "create_station",
clientID: this.lobbyConfig.clientID,
unitId: event.unitId,
});
}
private onSendTargetPlayerIntent(event: SendTargetPlayerIntentEvent) {
this.sendIntent({
type: "targetPlayer",