-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Init job.service.ts * feat: Add job.handler.ts * fix: Add job handler in job module * feat: Check sufficient resources for job * feat: Call methods from system.service to fulfil the job * feat: Add SystemType enum * fix: Use SystemUpgradeName instead of separate enum * fix: Refund job resource to empire * fix: Deduct job resources from empire * refactor: Init system.service refactoring for buildings * feat: Get building costs for job * feat: Get district costs for job * feat: Get technology costs for job * feat: Get system upgrade costs for job * fix: Update empire resources * feat: Complete job types * fix: Delete job, convert job cost map to record * fix: Call complete jobs method * feat: Build buildings with UpdateSystemDto, add constructor * fix: Build job building * feat: Check if methods were called with a job * fix: Circular module dependency * fix: Add technology to empire after job completion * fix: Use ForwardRef for cyclic dependency * fix: Increment user's technology count * feat: Init behavioral jobs * feat: Delete job on job.progress > job.total * chore: Fix some review comments --------- Co-authored-by: Adrian Kunz <[email protected]>
- Loading branch information
1 parent
52994c0
commit 7fcf170
Showing
14 changed files
with
480 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Injectable} from "@nestjs/common"; | ||
import {OnEvent} from "@nestjs/event-emitter"; | ||
import {JobService} from "./job.service"; | ||
import {Game} from "../game/game.schema"; | ||
|
||
@Injectable() | ||
export class JobHandler { | ||
constructor( | ||
private jobService: JobService, | ||
) { | ||
} | ||
|
||
@OnEvent('games.*.deleted') | ||
async onGameDeleted(game: Game): Promise<void> { | ||
await this.jobService.deleteMany({game: game._id}); | ||
} | ||
} |
Oops, something went wrong.