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.
textasset.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2023 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 <hjson.h>
20
21#include <map>
22#include <string>
23#include <vector>
24
25#include "engine/asset/asset.h"
26namespace cqsp::asset {
27class TextAsset : public Asset {
28 public:
29 std::string data;
30 AssetType GetAssetType() override { return AssetType::TEXT; }
31};
32
37 public:
38 // Relative path for the asset compared to the resource.hjson
39 std::string data;
40 std::string path;
41
42 operator std::string() { return data; }
43};
44
48class TextDirectoryAsset : public Asset {
49 public:
50 // Get the path of the assets
51 std::map<std::string, PathedTextAsset> paths;
53};
54
55class HjsonAsset : public Asset {
56 public:
57 Hjson::Value data;
59};
60
61class BinaryAsset : public Asset {
62 public:
63 std::vector<uint8_t> data;
65};
66} // namespace cqsp::asset
The base class for assets.
Definition: asset.h:157
Definition: textasset.h:61
std::vector< uint8_t > data
Definition: textasset.h:63
AssetType GetAssetType() override
Definition: textasset.h:64
Definition: textasset.h:55
Hjson::Value data
Definition: textasset.h:57
AssetType GetAssetType() override
Definition: textasset.h:58
Text asset which remembers what it's path is.
Definition: textasset.h:36
std::string data
Definition: textasset.h:39
std::string path
Definition: textasset.h:40
Definition: textasset.h:27
std::string data
Definition: textasset.h:29
AssetType GetAssetType() override
Definition: textasset.h:30
Asset to store a directory of text files, and remembers the path of the assets.
Definition: textasset.h:48
AssetType GetAssetType() override
Definition: textasset.h:52
std::map< std::string, PathedTextAsset > paths
Definition: textasset.h:51
Definition: asset.h:30
AssetType
Definition: asset.h:31
@ TEXT
text as the type parameter in resource.hjson
@ HJSON
hjson as the type parameter in resource.hjson