Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
packageindex.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <map>
20#include <string>
21
22#include "engine/asset/asset.h"
24
25namespace cqsp::asset {
26struct AssetEntry {
27 std::string path;
30 AssetEntry(const std::string& _path, AssetType _type) : path(_path), type(_type) {}
31};
32
37 public:
38 explicit PackageIndex(const IVirtualDirectoryPtr& directory);
39
40 AssetEntry& operator[](const std::string& name) { return assets[name]; }
41
42 private:
43 std::string path;
44 bool valid;
45 std::map<std::string, AssetEntry> assets;
46};
47} // namespace cqsp::asset
Definition: packageindex.h:36
std::map< std::string, AssetEntry > assets
Definition: packageindex.h:45
PackageIndex(const IVirtualDirectoryPtr &directory)
Definition: packageindex.cpp:24
std::string path
Definition: packageindex.h:43
AssetEntry & operator[](const std::string &name)
Definition: packageindex.h:40
bool valid
Definition: packageindex.h:44
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: asset.h:29
AssetType
Definition: asset.h:32
@ NONE
Definition: assetprototype.h:25
std::shared_ptr< IVirtualDirectory > IVirtualDirectoryPtr
Definition: vfs.h:37
Definition: packageindex.h:26
AssetEntry(const std::string &_path, AssetType _type)
Definition: packageindex.h:30
AssetEntry()
Definition: packageindex.h:29
std::string path
Definition: packageindex.h:27
AssetType type
Definition: packageindex.h:28