Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
3

Table Instance subclass heirarchy? [Solved]

Asked by
eLunate 5112 Trusted Moderation Voter Community Moderator
4 years ago

This question has been solved by the original poster.

I'm not talking about the object heirarchy

I need a simple way to build dictionary style 1D table containing all of the Instance subclass types, where each key is the ClassName (including types that are only inherited), and the value is a table that has its __index set to the table for the subclass.

What am I actually asking for?
I need either something to parse the entire list of Instance subclasses, or more ideally (currently) a table of tables with the inheritance structure already established.

Why? I need to provide override inheritance for Valkyrie method overrides, and until now I have lazily been simply checking the ClassName against the table of override methods.

0
Look into ReflectionMetadata. I can't give a more complete answer here because I don't know one myself. adark 5461 — 4y
1
I'm currently bugging TickerOfTime about it. If I get a solution, would it be acceptable to simply delete the answer if no solution is given? Or should I post my solution as an answer and leave it? eLunate 5112 — 4y

1 answer

Log in to vote
4
Answered by
eLunate 5112 Trusted Moderation Voter Community Moderator
4 years ago

Solved

local http = game:GetService("HttpService");
local instancetable = http:JSONDecode(http:GetAsync("http://jacob.easleycompany.com/api/apidump")).Class;
do local iOverrides = self.Overrides.Instance;
    for k,v in next, instancetable do
        iOverrides[k] = setmetatable({},{__index = iOverrides[v.BaseClassName]});
    end;
end;

This solution uses TickerOfTime's API Parser

Ad

Answer this question