View Single Post
  #24  
Old 06-23-2007, 08:43 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
onCreated gets called in each joined class in the order that they're joined. The super variable in the function is just an object to copy class names from initially so you dont have to retype all the class names again in the area that calls maketype().

Function inheritance works fine like this, there is no reason to change the script.

Observe:
PHP Code:
function onCreated() {
  
this.types null;
  
// X System
  
maketype("XObject"null, {"util_triggerall""type_xobject"});
  
maketype("XTestObject"TXObject, {"type_xtestobject"});
  
// Mud
  
maketype("XMudObject"TXObject, {"type_xmudobject"});
  
maketype("XMudItem"TXMudObject, {"type_xmuditem"});
  
maketype("XMudContainer"TXMudObject, {"type_xmudcontainer"});
  
maketype("XMudPlayer"TXMudContainer, {"type_xmudplayer"});
  
// Misc
  
maketype("Rectangle"null, {"type_rectangle"});
  
maketype("Vector"null, {"type_vector"});

And this.
PHP Code:
function onCreated() {
  
this.types null;
  
// X System
  
maketype("XObject"null, {"util_triggerall""type_xobject"});
  
maketype("XTestObject"null, {"util_triggerall""type_xobject""type_xtestobject"});
  
// Mud
  
maketype("XMudObject"null, {"util_triggerall""type_xobject""type_xmudobject"});
  
maketype("XMudItem"null, {"util_triggerall""type_xobject""type_xmudobject""type_xmuditem"});
  
maketype("XMudContainer"null, {"util_triggerall""type_xobject""type_xmudobject""type_xmudcontainer"});
  
maketype("XMudPlayer"null, {"util_triggerall""type_xobject""type_xmudobject""type_xmudcontainer""type_xmudplayer"});
  
// Misc
  
maketype("Rectangle"null, {"type_rectangle"});
  
maketype("Vector"null, {"type_vector"});

Both of those scripts will do the same thing.
__________________
Reply With Quote