BMax OOP rocks!

Miscellaneous Forums/General Discussion/BMax OOP rocks!


What would happen if say; TPlayer and TBuilding had a draw method from TEntity. But TTree had its own Draw overide. If you activated all the TEntity's draw methods, would it still activate the TTrees overide? or would it skip that one as it wouln't be a TEntity?

In that case, it would execute the TTree override. If you run the last example in the tutorial, you can see that it calls the appropriate Draw() Method for TPlayer, TBuilding, or whatever (even though it's using a TEntity variable). That is the main purpose of polymorphism - to use a more generalized Type, while retaining the object's correct behaviour.

I should probably try to make this more clear in the tutorial.