local D={ClassName="\079\098\106\101\099\116"}D.__index=D function D.new(...)local Y=setmetatable({},D)Y:Constructor(...)return Y end function D.Constructor(D)D.ClassName="\079\098\106\101\099\116"D._InheritsFrom={"\079\098\106\101\099\116"}end function D.CreateObjectFrom(R,D,Y)local y=Y local c=D.ClassName table.insert(y._InheritsFrom,c)y.ClassName=c setmetatable(y,D)return y end function D.IsA(Y,D)return table.find(Y._InheritsFrom,D)and true or false end function D.__tostring(D)return D.className or"\079\098\106\101\099\116"end return D
---
---OOP class to help create Objects.
---
---@class Object
---
local Object = {
    ClassName = "Object",
}
Object.__index = Object

--------------------------------------------------
-- Types
-- ...

--------------------------------------------------
-- Dependencies
-- ...

--------------------------------------------------
-- Constants
-- ...

--------------------------------------------------
-- Members

---
---Creates an object!
---@vararg any
---@return Object
---
function Object.new(...)
    local object = setmetatable({}, Object) ---@type Object
    object:Constructor(...)
    return object
end

---@private
---
---Constructor for the object
function Object:Constructor()
    -- Setup ClassName/Inheritance
    self.ClassName = "Object"
    self._InheritsFrom = { "Object" } ---@type string[]
end

---
---Will create an object, inheriting from a parent object.
---`childClass` is the class as a whole.
---`parentObject` is a specific object, returned from a .new() call.
---@generic C: Object
---@generic K: Object
---@param childClass C
---@param parentObject K
---@return C
---
function Object:CreateObjectFrom(childClass, parentObject)
    -- Setup new object Inheritance Data
    local newObject = parentObject
    local newClassname = childClass.ClassName
    table.insert(newObject._InheritsFrom, newClassname)
    newObject.ClassName = newClassname

    -- Override with new methods + members
    setmetatable(newObject, childClass)

    return newObject
end

---
---Informs us if this object inherits from the passed `className`
---@param className string
---@return boolean
---
function Object:IsA(className)
    return table.find(self._InheritsFrom, className) and true or false
end

---@private
---
---Will be automatically called when object is used in e.g., print()
function Object:__tostring()
    return self.className or "Object"
end

return Object
