src/Assets/Asset.hpp

Namespaces

Name
Engine
This namespace contains all of the necessary engine components.
Engine::Assets

Classes

Name
class Engine::Assets::Asset
union Engine::Assets::Asset::Event
struct Engine::Assets::Asset::Event::Loaded
struct Engine::Assets::Asset::Event::Unloaded
struct Engine::Assets::Asset::Event::Waiting

Source code

#pragma once
#include <queue>
#include <string>

namespace Engine {
    namespace Assets {
        class Asset {
        public:
            union Event {
                struct Loaded {
                    bool success;
                    int usage;
                } loaded;
                struct Unloaded {
                    bool success;
                } unloaded;
                struct Waiting {
                    Asset* other;
                } waiting;
            };

            explicit Asset(const std::string& name);
            virtual ~Asset() = 0;

            virtual void load();
            virtual void unload();
            const Event& getEvent() const {
                return event;
            }
        private:
            Event event;
        };
    }
}

Updated on 2021-10-12 at 20:07:08 +0000

results matching ""

    No results matching ""