Advertisement

How OO should my game be?

Started by August 01, 2001 02:42 AM
15 comments, last by xjussix 23 years, 6 months ago
what? that is crazy, no need to make them all virtual. Some classes are meant to be base classes and some aren''t. If you think you might want to override a function in the future go ahead and make it virtual, if there is little chance that you will override it then don''t.
An inlined virtual function? That works? it is either virtual or inlined, but it can''t be both.

An inlined function is expanded ... inline. Late-binding wouldn''t work there, would it?
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Advertisement
If my understanding is correct, inline virtual functions will be expanded when late binding isn''t used. That is, when you have an instance of an object, as opposed to a pointer to an object. The compiler knows what type the object is, so binding can be done at compile time, and inlines can be expanded.

If I''ve said anything wrong or stupid, please feel free to correct me, as I''m not totally clear on this stuff.

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
it''s pretty common practice to make every method virtual.. nothing wrong with that.



--
Float like a butterfly, bite like a crocodile.

--Float like a butterfly, bite like a crocodile.
Who''s "everyone"? The amateurs? Please.
VK
to give you a "case study" here''s what i do:

objects in the game, like player, enemy, world, etc are classes, and smaller objects like projectiles are structs, and the basic loop i usually have all modular. that''s usually how it goes i think. but in the end, it''s your style as always. disagree with me, cmon...

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Advertisement
Be better if what you call member variables were classes, and objects were just collections of these member variables.

It''d give the designer lots of power.
VK

This topic is closed to new replies.

Advertisement