1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 10:23:53 +00:00
openmw/apps/opencs/model/world/resources.hpp

45 lines
955 B
C++
Raw Normal View History

2014-07-04 10:46:57 +00:00
#ifndef CSM_WOLRD_RESOURCES_H
#define CSM_WOLRD_RESOURCES_H
#include <map>
2022-09-22 18:26:05 +00:00
#include <string>
#include <string_view>
2022-09-22 18:26:05 +00:00
#include <vector>
2014-07-04 10:46:57 +00:00
2014-07-07 13:20:05 +00:00
#include "universalid.hpp"
namespace VFS
{
class Manager;
}
2014-07-04 10:46:57 +00:00
namespace CSMWorld
{
class Resources
{
2022-09-22 18:26:05 +00:00
std::map<std::string, int> mIndex;
std::vector<std::string> mFiles;
std::string mBaseDirectory;
UniversalId::Type mType;
2014-07-04 10:46:57 +00:00
2022-09-22 18:26:05 +00: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 10:46:57 +00:00
2022-09-22 18:26:05 +00:00
void recreate(const VFS::Manager* vfs, const char* const* extensions = nullptr);
2017-08-19 07:43:31 +00:00
2022-09-22 18:26:05 +00:00
int getSize() const;
2014-07-04 10:46:57 +00:00
2022-09-22 18:26:05 +00:00
std::string getId(int index) const;
2014-07-04 10:46:57 +00:00
2022-09-22 18:26:05 +00:00
int getIndex(const std::string& id) const;
2014-07-04 10:46:57 +00:00
2022-09-22 18:26:05 +00:00
int searchId(std::string_view id) const;
2014-07-07 13:20:05 +00:00
2022-09-22 18:26:05 +00:00
UniversalId::Type getType() const;
2014-07-04 10:46:57 +00:00
};
}
#endif