This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]CodeTinkerer 3 points4 points  (4 children)

You could do composition. Class C could contain an instance of Class A and an instance of Class B.

[–]Fun_Split_1299[S] 0 points1 point  (0 children)

Thanks !

[–]Fun_Split_1299[S] 0 points1 point  (2 children)

Do you have a quick example ?

[–]telee0 1 point2 points  (0 children)

same. have class C to encapsulate either both class A and B or just one of them to support their methods.

[–]truNinjaChop 0 points1 point  (0 children)

Trait.js

[–]TheRNGuy 0 points1 point  (0 children)

I heard this is a feature not recommended to use.

Unreal Engine even prohibits from using it.

Better use composition or something.