Design of my Entity Class

Discussion about everything. New games, 3d math, development tips...
Post Reply
Jono

Design of my Entity Class

Post by Jono »

I am working on my own little irrlicht project. Everything that exists in my game has a class (ie. models, sounds, triggers etc) Each class inherits from my entity class which has some basic functions. My question is should i have 2 entity classes or one big one? One for simple entities that are static and never need to do anything. And one that contains all the addTrigger, runScript stuff for more advanced entities. OR one containing both of those things.

I realise i can do it either way and it will work, but is one way more efficient or better coding? If i had a single entity class that contained everything, a simple static model would never use most of the functions.

Does that make sense? :?

Jono.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Create an Entity base class and let your other classes inherit from them.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Jono

Post by Jono »

Yes, that's currently what i have. But should i have one base class or two?

One base class with basics like set name, set parent etc. Just to be used for static entities. And one for more advanced entities to inherit from. Ie for movement etc.

Or...

One base class containing both of the abilitites mentioned above.
cartoonit
Posts: 286
Joined: Mon Nov 15, 2004 6:36 pm

Post by cartoonit »

You should pick the one that means the least coding for yourself and the one that makes sense the most to your self.
Jono

Post by Jono »

Oooh, i like that advice. Do what makes sense to me :) thanks.
Post Reply