Fixed all errors.
This commit is contained in:
@@ -1,95 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "EHS.h"
|
||||
#include "Types.h"
|
||||
#include "Type.h"
|
||||
#include "Array.h"
|
||||
#include "Log.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseObj
|
||||
{
|
||||
private:
|
||||
Array<Type> hierarchy;
|
||||
BaseObj* parent;
|
||||
Type* hierarchy;
|
||||
UInt_64 hierarchySize;
|
||||
|
||||
public:
|
||||
virtual ~BaseObj();
|
||||
|
||||
BaseObj();
|
||||
|
||||
BaseObj(BaseObj&& base) noexcept;
|
||||
|
||||
BaseObj(const BaseObj& base);
|
||||
|
||||
BaseObj(BaseObj&& base) noexcept;
|
||||
BaseObj& operator=(BaseObj&& base) noexcept;
|
||||
|
||||
BaseObj& operator=(const BaseObj& base);
|
||||
|
||||
BaseObj& operator=(BaseObj&& base) noexcept;
|
||||
|
||||
bool operator!() const;
|
||||
|
||||
bool operator==(const BaseObj& base) const;
|
||||
|
||||
bool operator!=(const BaseObj& base) const;
|
||||
|
||||
bool HasType(const UInt_64 hashType) const;
|
||||
const Type* GetHierarchy() const;
|
||||
|
||||
bool HasType(const Str_8& type) const;
|
||||
UInt_64 GetHierarchySize() const;
|
||||
|
||||
protected:
|
||||
bool AddType(Str_8 type);
|
||||
bool HasType(UInt_64 typeHashId) const;
|
||||
|
||||
bool HasType(const Char_8* typeId) const;
|
||||
|
||||
public:
|
||||
Type GetType() const;
|
||||
|
||||
Type GetType(const UInt_64 hashType) const;
|
||||
|
||||
Type GetType(const Str_8& type) const;
|
||||
UInt_64 GetTypeIdSize() const;
|
||||
|
||||
const Char_8* GetTypeId() const;
|
||||
|
||||
UInt_64 GetTypeHashId() const;
|
||||
|
||||
const Array<Type>& GetHierarchy() const;
|
||||
|
||||
void SetParent(BaseObj* newParent);
|
||||
|
||||
BaseObj* GetParent();
|
||||
|
||||
BaseObj* GetParent(const UInt_64 hashType);
|
||||
|
||||
BaseObj* GetParent(const Str_8& type);
|
||||
|
||||
virtual BaseObj* Clone() const;
|
||||
|
||||
virtual bool IsValid() const;
|
||||
protected:
|
||||
void AddType(const Char_8* id);
|
||||
};
|
||||
|
||||
inline bool BaseObj::HasType(const UInt_64 hashType) const
|
||||
{
|
||||
for (UInt_64 i = 0; i < hierarchy.Size(); ++i)
|
||||
if (hashType == hierarchy[i].GetHashId())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
inline Type BaseObj::GetType(const UInt_64 hashType) const
|
||||
{
|
||||
for (UInt_64 i = 0; i < hierarchy.Size(); ++i)
|
||||
if (hashType == hierarchy[i].GetHashId())
|
||||
return hierarchy[i];
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
inline BaseObj* BaseObj::GetParent(const UInt_64 hashType)
|
||||
{
|
||||
BaseObj* result = GetParent();
|
||||
|
||||
while (result && !result->HasType(hashType))
|
||||
result = result->GetParent();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user