mikemrm
05-18-2011, 03:53 AM
not sure how i would search something like that up...
Theres this game that im looking at that ive modded a bit, and so theres a core file that import the addon file in that addon file there is the __init__(self, core) making it possible to execute defs inside the core so they do something like this
<core>
class core:
def printHello():
print "Hello Moto"
def importme():
importcode
</core>
<addon>
class Addon:
def __init__(self, core):
self.core = core
def saysomething():
self.core.printHello()
</addon>
and if you executed saysomething it would run printHello
im not sure how they were able to pass the class over to that class as if you were importing it...
i hope this is clear enough, please help.
Theres this game that im looking at that ive modded a bit, and so theres a core file that import the addon file in that addon file there is the __init__(self, core) making it possible to execute defs inside the core so they do something like this
<core>
class core:
def printHello():
print "Hello Moto"
def importme():
importcode
</core>
<addon>
class Addon:
def __init__(self, core):
self.core = core
def saysomething():
self.core.printHello()
</addon>
and if you executed saysomething it would run printHello
im not sure how they were able to pass the class over to that class as if you were importing it...
i hope this is clear enough, please help.