2007/3/6, Giel van Schijndel <[EMAIL PROTECTED]>:
Dennis Schridde schreef:
> Am Dienstag, 6. März 2007 schrieb Giel van Schijndel:
>> Author: muggenhor
>> Date: Tue Mar  6 22:21:13 2007
>> New Revision: 854
>> URL: http://svn.gna.org/viewcvs/warzone?rev=854&view=rev
>> Log:
>>  * Add Vertex base class (bases/vertex.hpp) to derive from for an interface
>> to a coordinate set (x,y,z-coords from listener and sound source) * class
>> soundDecoding:
>>   * Add soundDecoding::getSampleCount() which retrieves the amount of
>> samples contained in the opened audio file (only works when file is
>> seekable) * Remove dual decoding function in favor of the one that
>> allocates a buffer on its own * interface.cpp:
>>   * Modify templated function validID() to also modify the ID number with a
>> constant correction (ID -= 1) * Fix sound_Destroy2DStream to check the ID
>> number for validity before using it * add subclass soundListener to
>> soundContext which is derived from Vertex, this is to handle the listener
>> seperately * class soundSource:
>>   * Removed initialization of OpenAL Source with a bunch of zeros
>>   * fix some error strings
>>   * Derive from Vertex and implement all its interface (virtual) functions
> Maybe we are getting philosophical here, but is a soundListener or a
> soundSource a Vertex? Shouldn't it _contain_ a Vertex?
Yes, it should contain a Vertex. But A) inheriting from a class is (IMO)
mainly to inherit its interface (which in this case is exactly the same
for a soundListener and soundSource). And B) when inheriting class
Vertex into class soundSource/soundListener, class
soundSource/soundListener will contain class Vertex.

Maybe I should call Vertex different. Because I want it to contain XYZ
coordinates, velocity along the XYZ axis, and orientation on XYZ axis.
So if you know a better name describing those three main properties
(i.e. having a position, orientation and speed) please tell me.

Oh and btw philosophy is indeed something on which I gladly spend my
time. ;-)

Staying with on puristic object oriented topic, there is no
"inheriting into", there is only "inheriting from".

When class Bicycle inherits from class Transportation, you essentially
say that Bicycle is-a [kind of] Transportation.

Usually, when this is-a relationship dosn't hold true, then a
composition pattern is often the right way of doing things.

For instance, a Car is not a kind of Engine even though both can be
start() 'ed. Instead, a Car contains an Engine and Car.start() would,
at least at some point, redeligate the call to Engine.start().

While a SoundSource might be a point in time and space, I don't think
it fully lives up to everything that makes up a complete Vertex
(having lookud up the defenition of 'Vertex' on Google define). And
SoundListener sounds like an interface to me, but I don't know if C++
even have interfaces.

PS. this all comes from my Java background, so if C++ see things
diferently... oh well :-)

Venlig hilsen / Kind regards,
Christian Vest Hansen.
Warzone-dev mailing list

Reply via email to