local w=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local O=require(w:WaitForChild("\078\101\118\101\114\109\111\114\101"))local T=O("\083\116\100")local I=T.rquery local q={__type="\099\111\109\112\111\110\101\110\116"}local B={__index=q}function q.Execute(O,w)error(O.Name.."\058 \069\120\101\099\117\116\101\058 \078\079 \082\085\066\069\082")print("\067\111\103\110\105\116\111 \101\114\103\111 \115\117\109")return nil end function q.TryExecute(O,w)local q=I.ComponentsFolderOrNil(w)if q~=nil and#q>0 then for w,O in pairs(O.Requires)do local I=#q if I==0 then return false end if I>0 then local w=(T.linq(q)):firstOrDefault(function(w)return w.Name==O end)if w==nil then return false end end end O:Execute(w)return true end return false end function q.new(w,O)local T=setmetatable({},B)T.Name=w or"\085\078\078\065\077\069\068\095\067\079\077\080\079\078\069\078\084"T.Requires=O or{}return T end return q
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local require = require(ReplicatedStorage:WaitForChild("Nevermore"))
local std = require("Std")
local rq = std.rquery

local component = {
    __type = "component"
}

local mt = { __index = component }

function component:Execute(gameObject) 
    error(self.Name .. ": Execute: NO RUBER")
    print("Cognito ergo sum")
    return nil
end

function component:TryExecute(gameObject)
    local components = rq.ComponentsFolderOrNil(gameObject)
    
    if components ~= nil and #components > 0 then
        for _, value in pairs(self.Requires) do
            local componentCount = #components
            if componentCount == 0 then return false end
            if componentCount > 0 then
                local foundComponent = std.linq(components):firstOrDefault(
                    function(val)
                        return val.Name == value
                    end)
                if foundComponent == nil then
                    return false
                end
            end
        end
        self:Execute(gameObject)
        return true
    end
    return false
end

function component.new(componentName, requiredComponentAttributes)
    local self = setmetatable({}, mt)
    self.Name = componentName or "UNNAMED_COMPONENT"
    self.Requires = requiredComponentAttributes or {}
    return self
end

return component