I've stumbled across this article and it seems kinda interesting:
http://blog.terava.info/past/2011/1/4/g ... ce_in_cpp/
It looks like a cool way to improve object inheritance, but what are your guy's thoughts on it?
Using Templates for Game Object Inheritance
Moderator: Coders of Rage
-
- Chaos Rift Newbie
- Posts: 4
- Joined: Mon May 30, 2011 1:55 pm
- Favorite Gaming Platforms: PC, iOS
- Programming Language of Choice: C++
Re: Using Templates for Game Object Inheritance
I use CRTP all the time - it is very handy.
I prefer it over dynamic inheritance.
I prefer it over dynamic inheritance.
-
- Chaos Rift Newbie
- Posts: 4
- Joined: Mon May 30, 2011 1:55 pm
- Favorite Gaming Platforms: PC, iOS
- Programming Language of Choice: C++
Re: Using Templates for Game Object Inheritance
Im not sure if I'm correct, but it seems like a way to pick and choose your super classes via templates. Is this right?
Re: Using Templates for Game Object Inheritance
Yeah, pretty much.Mattonaise wrote:Im not sure if I'm correct, but it seems like a way to pick and choose your super classes via templates. Is this right?
I really enjoyed reading it, and after a few link jumps, and reading through other opinions on different ways to style objects, I'm content with the way I have my own set up. Although I am considering changing the way I have components communicate with each other.
-
- Chaos Rift Newbie
- Posts: 4
- Joined: Mon May 30, 2011 1:55 pm
- Favorite Gaming Platforms: PC, iOS
- Programming Language of Choice: C++
Re: Using Templates for Game Object Inheritance
Furthermore, it seems like a way to have a sort of "component system", but built at compile time instead of runtime.
Re: Using Templates for Game Object Inheritance
Yeah, that's essentially what it is. I'm curious as to how different "Mix-Ins" communicate with each other.Mattonaise wrote:Furthermore, it seems like a way to have a sort of "component system", but built at compile time instead of runtime.