2016-10-22 18:06:27 +02:00
|
|
|
/*****************************************************************************
|
2018-06-15 14:07:34 +02:00
|
|
|
* Copyright (c) 2014-2018 OpenRCT2 developers
|
2016-10-22 18:06:27 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-10-22 18:06:27 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-10-22 18:06:27 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2016-11-13 14:08:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-04-20 20:58:59 +02:00
|
|
|
#include <memory>
|
2016-10-22 18:06:27 +02:00
|
|
|
#include "../common.h"
|
2017-06-14 13:31:27 +02:00
|
|
|
#include "RideGroupManager.h"
|
|
|
|
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2018-02-14 09:42:26 +01:00
|
|
|
struct track_design_file_ref
|
2016-10-22 18:06:27 +02:00
|
|
|
{
|
|
|
|
utf8 * name;
|
|
|
|
utf8 * path;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2017-01-05 18:51:31 +01:00
|
|
|
#include <string>
|
|
|
|
|
2017-06-11 13:53:37 +02:00
|
|
|
namespace OpenRCT2
|
|
|
|
{
|
|
|
|
interface IPlatformEnvironment;
|
|
|
|
}
|
2016-12-12 02:30:27 +01:00
|
|
|
|
2016-10-22 18:06:27 +02:00
|
|
|
interface ITrackDesignRepository
|
|
|
|
{
|
|
|
|
virtual ~ITrackDesignRepository() = default;
|
|
|
|
|
|
|
|
virtual size_t GetCount() const abstract;
|
2018-06-20 17:28:51 +02:00
|
|
|
virtual size_t GetCountForObjectEntry(uint8_t rideType, const std::string &entry) const abstract;
|
|
|
|
virtual size_t GetCountForRideGroup(uint8_t rideType, const RideGroup * rideGroup) const abstract;
|
|
|
|
virtual std::vector<track_design_file_ref> GetItemsForObjectEntry(uint8_t rideType,
|
2018-01-19 01:32:53 +01:00
|
|
|
const std::string &entry) const abstract;
|
2018-06-20 17:28:51 +02:00
|
|
|
virtual std::vector<track_design_file_ref> GetItemsForRideGroup(uint8_t rideType,
|
2018-01-19 01:32:53 +01:00
|
|
|
const RideGroup * rideGroup) const abstract;
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
virtual void Scan(int32_t language) abstract;
|
2017-01-05 18:51:31 +01:00
|
|
|
virtual bool Delete(const std::string &path) abstract;
|
|
|
|
virtual std::string Rename(const std::string &path, const std::string &newName) abstract;
|
|
|
|
virtual std::string Install(const std::string &path) abstract;
|
2016-10-22 18:06:27 +02:00
|
|
|
};
|
|
|
|
|
2018-04-20 23:16:37 +02:00
|
|
|
std::unique_ptr<ITrackDesignRepository> CreateTrackDesignRepository(const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
2018-01-19 01:32:53 +01:00
|
|
|
std::string GetNameFromTrackPath(const std::string &path);
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2018-02-01 18:49:14 +01:00
|
|
|
void track_repository_scan();
|
|
|
|
bool track_repository_delete(const utf8 *path);
|
|
|
|
bool track_repository_rename(const utf8 *path, const utf8 *newName);
|
|
|
|
bool track_repository_install(const utf8 *srcPath);
|