Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the management of HistoricalEvents #896

Merged
merged 5 commits into from
May 28, 2023
Merged

Conversation

bevans2000
Copy link
Member

This PR has a number of changes to HistoricalEvents

  • Container is a Unit
  • Constructors can use the properties of the Container

The benefit of this allows the EventTab to render the most suitable entity of an event in a tool window. To support this a new Entity interface that represents that any top-level Object managed by the Simulation, i.e. Unit, Scientific Study, Mission or Transportable.
fix #827

Remove the SimpleEvent class and the caches from HistoricalEventManager

Changes:
- Delete SimpleEvent class
- EventTableModel converted to use HistoricalEvent
- Model also uses a generic approach to blocking categories & events instead of if statements in the logic
- EventFilter is generic based on the avaialble EventTypes
- HistoricalEventManager adds a synchronised region when events are being added
- Reintroduced a cap on the number of transient events held; set to 50.

Part of #827
Create a new Entity interface that represents the top levle objects that the simulation controls.
This entity is used to centralise the opening of the appropriate UI Window to show the details of
the entity. This oculd be a Mission or Unit Window.
The objective is to remove the coupling between the various UI Windows.

Changes:
- Create Entity interface and implement is Unit, Mission & Transportable
- MainDesktopPane replaces the openUnitWindow with a generic showDetails method
- The new showDetails method acts as a factory to select the appropriate UI window to display the selection.
- Update all calls to the old openUnitWindow with the replacement
- Update direct calls to the MissionWindow with the generic Desktop method
- Move the open details window logic into the MonitorWindow class

Part of #827
Changes:
- HistoricalEvent uses a Coordinates class for the coordinate column
- HistoricalEvent uses a Unit for the container property
- Add a cut down constructor where some properties are derived from the container
- EventTableModel will locate the best Entity instance from an event
- Update the constructors of the HistoricalEvent subclasses
- Event tab in Monitor window enables the Details button
- Event console command seperates out the coordinates and locations

Part of #827
Changes:
- ScientificStudy implements Entity interface
- DesktopPane showDetails method now supports ScientificStudy to display the details

Part of #827
@bevans2000 bevans2000 requested a review from mokun May 28, 2023 20:24
@mokun mokun merged commit 60f2c66 into master May 28, 2023
@bevans2000 bevans2000 deleted the histevent_issue827 branch May 29, 2023 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make HistoricalEvents structured
2 participants