mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 23:38:09 -05:00
Material loading base
This commit is contained in:
29
src/ObjLoading/AssetLoading/AbstractGdtEntryReader.h
Normal file
29
src/ObjLoading/AssetLoading/AbstractGdtEntryReader.h
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Obj/Gdt/GdtEntry.h"
|
||||
|
||||
class GdtReadingException : public std::exception
|
||||
{
|
||||
public:
|
||||
explicit GdtReadingException(std::string message);
|
||||
_NODISCARD const char* what() const override;
|
||||
|
||||
private:
|
||||
std::string m_message;
|
||||
};
|
||||
|
||||
class AbstractGdtEntryReader
|
||||
{
|
||||
protected:
|
||||
explicit AbstractGdtEntryReader(const GdtEntry& entry);
|
||||
|
||||
_NODISCARD std::string ReadStringProperty(const std::string& propertyName, std::string defaultValue = std::string()) const;
|
||||
_NODISCARD bool ReadBoolProperty(const std::string& propertyName, bool defaultValue = false) const;
|
||||
_NODISCARD int ReadIntegerProperty(const std::string& propertyName, int defaultValue = 0) const;
|
||||
_NODISCARD float ReadFloatProperty(const std::string& propertyName, float defaultValue = 0.0f) const;
|
||||
|
||||
const GdtEntry& m_entry;
|
||||
};
|
Reference in New Issue
Block a user