Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
resource_loader.h
Go to the documentation of this file.
1#ifndef RESOURCE_LOADER_H
2#define RESOURCE_LOADER_H
3
4#ifndef LOGIC_ONLY
5
6#include <string>
7
9
13{
14public:
16
21 constexpr int get_n_items() const noexcept { return 20; }
22
24 std::string get_current() const noexcept { return m_descriptor; }
25
27 int get_index() const noexcept { return m_index; }
28
30 bool is_done() const noexcept;
31
32 void process_next();
33
34private:
35
36 std::string m_descriptor;
37
38 int m_index;
39
40 bool m_is_done{false};
41};
42
45double get_progress(const resource_loader& loader) noexcept;
46
49
50#endif // LOGIC_ONLY
51
52#endif // RESOURCE_LOADER_H
Definition game_resources.h:39
Loads resources gradually, so that progress can be displayed.
Definition resource_loader.h:13
resource_loader()
Definition resource_loader.cpp:8
bool is_done() const noexcept
Are all resources loaded?
Definition resource_loader.cpp:26
void process_next()
Definition resource_loader.cpp:41
std::string get_current() const noexcept
Describe the current progress.
Definition resource_loader.h:24
constexpr int get_n_items() const noexcept
The number of resource groups that need to be loaded.
Definition resource_loader.h:21
int get_index() const noexcept
Get the index of the current progress.
Definition resource_loader.h:27
double get_progress(const resource_loader &loader) noexcept
Get the progress of the loader.
Definition resource_loader.cpp:14
void test_resource_loader()
Test this class.
Definition resource_loader.cpp:157