When a class inherits from another class, the node that is instantiated from that class includes a single copy of all of the fields defined by its class and all inherited classes. This also means any classes inherited by that class, and so on down the line.
Let's say we have some classes defined this way:
- Class FOO with fields A, B and C
- Class BAR with fields C, D, E and F (notice field C is repeated here)
- Class MIGHTY with fields G and H, and B (notice field B is repeated here)
Also assume that class MIGHTY inherits from both class FOO and class BAR.
A node instantiated from class MIGHTY would then have fields, A, B, C, D, E, F, G and H.
Notice that MIGHTY has one field named B and one field named C even though they appear multiple times in the hierarchy. This is a unique distinction in HeroScript that is not common in other object-oriented languages.
Any available Method can be called on a Node based on what class(es) the node is derived from.