Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Find_My_Vehicle
Re: Find_My_Vehicle [message #457045 is a reply to message #456821] Fri, 07 October 2011 00:27 Go to previous messageGo to previous message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma:
General (1 Star)
VehicleGameObject is derived from GameObject.
This means VehicleGameObject is everything GameObject is +more.

The code for this would be
class VehicleGameObject : public GameObject{...};

*note: In the scripts.dll source, there might be an inheritance in between or multiple inheritance. I did not check this code so it may look a bit different in the real source. This does however reflect how VehicleGameObject is a GameObject

You can ofcourse have this stacked
class X{...};

//Y is X +more
class Y : public X{...};

//Z is Y +more
class Z : public Y{...};

As Z derives from Y, and Y from X, Z is also an X.

Or multiple
class A{...};
class B{...};

class C : public A, B{...};

C is both an A and B, BUT A is not a B and B is not an A in this case.

http://www.cprogramming.com/tutorial/lesson20.html

Then you also get things like access modifiers and the virtual keyword that all affect inheritance behavior, but you can search that up when you need it Wink


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Fri, 07 October 2011 00:37]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: old tokenclass
Next Topic: Tool for renaming w3d-files?
Goto Forum:
  


Current Time: Wed Jan 15 00:52:50 MST 2025

Total time taken to generate the page: 0.00702 seconds