Class extends and Problems with extended Properties Javascript

Viewed 20

So Im extending a class. My Parent Class is the Item Class

class Item {
    static Name = ItemTypes
    static Count = 1
}

now I have an Block Class that extends the Item Class:

class Block extends Item {
    static Block = { name: Item.Name, states: {}}
    static tag = {}
}

Now thing is, I want to get the static properties of these classes using Object.keys(Item) and later Object.keys(Block)

So Block is suppose to have all properties from Item but a few own on top, however when using Object.keys it only gives the properties that are defined in its own class and none from Item.

(And I need to get the properties to loop over them, problem is there are a few and with that I mean hundreds of classes that build on Item and Block and theres a code that reads these properties, so I cannot just predefine an Array for every single Class where it records what properties its parent has.)

So how do I get the properties from these classes?? Is that even possible?

0 Answers
Related