From 84bc8a47e8af65388ac534ec32b4a9f3b0102a15 Mon Sep 17 00:00:00 2001 From: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com> Date: Fri, 12 May 2023 13:58:15 +0200 Subject: [PATCH] Vehicles can now be the leader of a simulated region --- CHANGELOG.md | 1 + ...view-behavior-assign-leader.component.html | 61 +++++- ...erview-behavior-assign-leader.component.ts | 103 ++++++++-- ...egion-overview-behavior-tab.component.html | 3 +- .../vehicle-occupation-editor.component.html | 3 + .../utils/occupations/exercise-occupation.ts | 3 + shared/src/models/utils/occupations/index.ts | 1 + .../utils/occupations/is-leader-occupation.ts | 22 +++ .../src/simulation/behaviors/assign-leader.ts | 184 ++++++++++-------- ...dd-leadership-vehicles-to-assign-leader.ts | 90 +++++++++ .../state-migrations/migration-functions.ts | 2 + shared/src/state.ts | 2 +- .../src/store/action-reducers/simulation.ts | 74 +++++++ shared/src/utils/validators/is-string-set.ts | 23 +++ test-scenarios | 2 +- 15 files changed, 480 insertions(+), 94 deletions(-) create mode 100644 shared/src/models/utils/occupations/is-leader-occupation.ts create mode 100644 shared/src/state-migrations/35-add-leadership-vehicles-to-assign-leader.ts create mode 100644 shared/src/utils/validators/is-string-set.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f782d00a..9751b8faf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project does **not** adhere to [Semantic Versioning](https://semver.org - Add behaviors button now opens towards the top. - Simulated regions can now send patients to any hospital. The hospitals tab was removed. +- The assign leader behavior now prioritized vehicles instead of gfs. Custom command vehicles can be set in the frontend. ### Fixed diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/assign-leader/simulated-region-overview-behavior-assign-leader.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/assign-leader/simulated-region-overview-behavior-assign-leader.component.html index 5aa889b44..ac9cad531 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/assign-leader/simulated-region-overview-behavior-assign-leader.component.html +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/assign-leader/simulated-region-overview-behavior-assign-leader.component.html @@ -1,9 +1,64 @@ -
- {{ (currentLeader | async)?.personnelType | personnelName }} +
+ {{ currentLeader.personnelType | personnelName }}
+
Keine Führungskraft zugewiesen.