2019-04-08 20:34:24 +02:00
|
|
|
/*****************************************************************************
|
2024-01-01 12:52:28 +01:00
|
|
|
* Copyright (c) 2014-2024 OpenRCT2 developers
|
2019-04-08 20:34:24 +02:00
|
|
|
*
|
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
2019-07-07 19:40:58 +02:00
|
|
|
#include "core/IStream.hpp"
|
|
|
|
#include "ride/TrackDesign.h"
|
|
|
|
|
2019-04-08 20:34:24 +02:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface to import scenarios and saved games.
|
|
|
|
*/
|
2020-07-30 23:19:53 +02:00
|
|
|
struct ITrackImporter
|
2019-04-08 20:34:24 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ITrackImporter() = default;
|
|
|
|
|
|
|
|
virtual bool Load(const utf8* path) abstract;
|
2020-07-30 23:19:53 +02:00
|
|
|
virtual bool LoadFromStream(OpenRCT2::IStream* stream) abstract;
|
2019-04-08 20:34:24 +02:00
|
|
|
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] virtual std::unique_ptr<TrackDesign> Import() abstract;
|
2019-04-08 20:34:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace TrackImporter
|
|
|
|
{
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] std::unique_ptr<ITrackImporter> Create(const std::string& hintPath);
|
|
|
|
[[nodiscard]] std::unique_ptr<ITrackImporter> CreateTD4();
|
|
|
|
[[nodiscard]] std::unique_ptr<ITrackImporter> CreateTD6();
|
2019-04-08 20:34:24 +02:00
|
|
|
|
|
|
|
bool ExtensionIsRCT1(const std::string& extension);
|
|
|
|
} // namespace TrackImporter
|