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

Add support for multiple Vehicle Specifications #861

Merged
merged 6 commits into from
Apr 24, 2023
Merged

Conversation

bevans2000
Copy link
Member

This PR adds the ability to define any number of Vehicle Specification beyond one per Vehicle Type.

The change also introduces "long range explorer" specification which is a 2nd variant of a Explorer rover. This is then used in the Alpha Base settlement template.

Changes allow the Vehicle Specification to have an optional image name. By default the existing approach based on VehicleType is used.

Note the merge of VehicleController had problems so the edits will appear repeated.

Further work is to change Vehicle to use the properties of VehicleSpecification instead of copying them.
fix #854

Changes:
- Add a VehicleType property to VehicleSpec
- Update vehicles.xml to include the type property; currently same as the name
- VehicleConfig parses the new type property and convert to VehicleType
- Created a VehicleFactory that centralises Vehicle creation
- Generantename method moved from Vehicle to VehicleFactory
- Update the creators of Vehcile to use the new factory class

Part of #854
Changes:
- VehicleFactory passed the VehicleSpec to constructor
- Vehicle & subclasses take VehicleSpec as argument
- Unit test use new Vehicle constructor
- Remove Vehicle.getDescription method that uses the vehicle type

Part of #854
Changes:
- Replace property vehicleTypeString with specName in Vehicle which is the name of the seed VehicleSpecification
- UI & console classes update to show Vehicle specification name instead of type
- SVG Vehicle images now selected based on the VehicleType value instead of the type string
- Updated to svg image mapping to aligned with LUV
- Reworked the SVGMapUtil test to use the new approach
- Only one VehicleGood object created per VehicleType in the GoodsUtil class
- VehicleGood counts settlement vehicles based on the VehicleType not the spec
- Maintenance scope based on VehicleType value at base; update parts.xml to align to luv
- Rover class add extra maintenance scoep for "rover"
- Dropped MockVehicle class as it did not follow the VehcileSpecification constructor pattern
- Reworked TestContaiment to use the AbstractMarsSimUnitTest to provided required Units
- AbstractMarsSimUnitTest registers new Garage building with the BuildingManager

Part of #854
Changes:
- VehicleSpec has an optional base image property used in SVG drawing; default is the VehicleType
- Vehicle base images used in all SVG Util lookup for drawing in General tab of Vehicle
- VehicleMapLayer uses new baseImage property for rendering
- SVG test updated
- VehicleTableModel uses the vehicle specification name instead of the type
- General vehicle tab show vehicle specification as well as type
- Add a new "Long Explorer" to vehicles.xml giving a explorer with a longer range
- Alpha Base creates "Long Explorer" vehicles
- Created a new SVG image for the long explorer, matches existing dimensions to reuse overlays
- svg image mappings added for new vehicle spec
- Settlement vehicle console command displays vehicle specification instead of type

Part of #854
@bevans2000 bevans2000 added this to the 3.6.0 milestone Apr 24, 2023
@bevans2000 bevans2000 requested a review from mokun April 24, 2023 20:43
@mokun mokun merged commit 968875a into master Apr 24, 2023
@bevans2000 bevans2000 deleted the vehicletype_issue854 branch April 24, 2023 22:31
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.

Allow different Vehicle variants
2 participants