/
CAsset.hpp
54 lines (37 loc) · 1.25 KB
/
CAsset.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2019 Ryo Suzuki
// Copyright (c) 2016-2019 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include <Siv3D/HashTable.hpp>
# include <Siv3D/String.hpp>
# include <Siv3D/Asset.hpp>
# include "IAsset.hpp"
namespace s3d
{
class CAsset : public ISiv3DAsset
{
private:
std::array<HashTable<String, std::unique_ptr<IAsset>>, 3> m_assetLists;
public:
CAsset();
~CAsset() override;
void init() override;
void update() override;
bool registerAsset(AssetType assetType, const String& name, std::unique_ptr<IAsset>&& asset) override;
IAsset* getAsset(AssetType assetType, const String& name) override;
bool isRegistered(AssetType assetType, const String& name) const override;
bool preload(AssetType assetType, const String& name) override;
void release(AssetType assetType, const String& name) override;
void releaseAll(AssetType assetType) override;
void unregister(AssetType assetType, const String& name) override;
void unregisterAll(AssetType assetType) override;
bool isReady(AssetType assetType, const String& name) const override;
};
}