Archive 17/01/2023.

Convenient object creation

rku

This is very minor bit but for me personally makes creating objects 10-fold more comfortable:

    /// Create an object by type hash. Return pointer to it or null if no factory found.
    template<typename T>
    inline SharedPtr<T> CreateObject()
    {
        SharedPtr<Object> obj = CreateObject(T::GetTypeStatic());
        return SharedPtr<T>(static_cast<T*>(obj.Get()));
    }

Add this to Context.h and objects can be created like: