1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 12:39:53 +00:00
OpenMW/apps/opencs/model/world/resources.hpp

45 lines
955 B
C++
Raw Normal View History

2014-07-04 12:46:57 +02:00
#ifndef CSM_WOLRD_RESOURCES_H
#define CSM_WOLRD_RESOURCES_H
#include <map>
2022-09-22 21:26:05 +03:00
#include <string>
#include <string_view>
2022-09-22 21:26:05 +03:00
#include <vector>
2014-07-04 12:46:57 +02:00
2014-07-07 15:20:05 +02:00
#include "universalid.hpp"
namespace VFS
{
class Manager;
}
2014-07-04 12:46:57 +02:00
namespace CSMWorld
{
class Resources
{
2022-09-22 21:26:05 +03:00
std::map<std::string, int> mIndex;
std::vector<std::string> mFiles;
std::string mBaseDirectory;
UniversalId::Type mType;
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
public:
/// \param type Type of resources in this table.
Resources(const VFS::Manager* vfs, const std::string& baseDirectory, UniversalId::Type type,
const char* const* extensions = nullptr);
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
void recreate(const VFS::Manager* vfs, const char* const* extensions = nullptr);
2017-08-19 03:43:31 -04:00
2022-09-22 21:26:05 +03:00
int getSize() const;
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
std::string getId(int index) const;
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
int getIndex(const std::string& id) const;
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
int searchId(std::string_view id) const;
2014-07-07 15:20:05 +02:00
2022-09-22 21:26:05 +03:00
UniversalId::Type getType() const;
2014-07-04 12:46:57 +02:00
};
}
#endif