Add Asset system
- Add Abstract Asset class which defines Assets - Add AssetManager class to keep track of all the Asset - Add AssetFile class to cache the asset without loading it - Add UUID class to uniquely identify assets - Add MetaFile class to load meta asset files
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
|
||||
namespace Copium
|
||||
{
|
||||
class UUID
|
||||
{
|
||||
private:
|
||||
uint64_t msb;
|
||||
uint64_t lsb;
|
||||
static std::random_device randomDevice;
|
||||
static std::mt19937 randomGenerator;
|
||||
static std::uniform_int_distribution<uint64_t> randomDistribution;
|
||||
public:
|
||||
UUID();
|
||||
UUID(uint64_t msb, uint64_t lsb);
|
||||
// Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
UUID(const std::string& uuidString);
|
||||
|
||||
std::string ToString() const;
|
||||
|
||||
bool operator==(const UUID& rhs);
|
||||
bool operator!=(const UUID& rhs);
|
||||
bool operator<(const UUID& rhs);
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const UUID& uuid);
|
||||
|
||||
private:
|
||||
uint8_t HexToDec(char c) const;
|
||||
char DecToHex(uint8_t byte) const;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user