2019-04-08 20:34:24 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include "TrackImporter.h"
|
|
|
|
|
|
|
|
#include "core/Path.hpp"
|
|
|
|
#include "core/String.hpp"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace TrackImporter
|
|
|
|
{
|
|
|
|
std::unique_ptr<ITrackImporter> Create(const std::string& hintPath)
|
|
|
|
{
|
|
|
|
std::unique_ptr<ITrackImporter> trackImporter;
|
|
|
|
std::string extension = Path::GetExtension(hintPath);
|
|
|
|
if (ExtensionIsRCT1(extension))
|
|
|
|
{
|
2019-05-02 19:39:45 +02:00
|
|
|
trackImporter = CreateTD4();
|
2019-04-08 20:34:24 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
trackImporter = CreateTD6();
|
|
|
|
}
|
|
|
|
return trackImporter;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ExtensionIsRCT1(const std::string& extension)
|
|
|
|
{
|
|
|
|
return String::Equals(extension, ".td4", true);
|
|
|
|
}
|
2019-07-07 19:40:58 +02:00
|
|
|
} // namespace TrackImporter
|