| 73 | |
| 74 | public: |
| 75 | std::optional<TrackRepositoryItem> Create(int32_t, const std::string& path) const override |
| 76 | { |
| 77 | auto td = TrackDesignImport(path.c_str()); |
| 78 | if (td != nullptr) |
| 79 | { |
| 80 | TrackRepositoryItem item{}; |
| 81 | item.Name = GetNameFromTrackPath(path); |
| 82 | item.Path = path; |
| 83 | item.RideType = td->trackAndVehicle.rtdIndex; |
| 84 | item.ObjectEntry = std::string(td->trackAndVehicle.vehicleObject.Entry.name, 8); |
| 85 | if (IsTrackReadOnly(path)) |
| 86 | { |
| 87 | item.flags.set(TrackRepoItemFlag::readOnly); |
| 88 | } |
| 89 | return item; |
| 90 | } |
| 91 | |
| 92 | return std::nullopt; |
| 93 | } |
| 94 | |
| 95 | protected: |
| 96 | void Serialise(DataSerialiser& ds, const TrackRepositoryItem& item) const override |
no test coverage detected