Code: Select all
t1={ var=0 }
function t1:func1func()
self.var = self.var + 1
endfunction
t2 = { var=0 }
t2:func2func = t1:func1func
Code: Select all
t1={ var=0 }
function t1:func1func()
self.var = self.var + 1
endfunction
t2 = { var=0 }
t2:func2func = t1:func1func
Code: Select all
t1={ var=0 }
function t1:func1func()
self.var = self.var + 1
endfunction
t2 = { var=0 }
t2:func2func = t1:func1func
Code: Select all
; Defines the class
myClass=
{ var=0,
func1 = function() self.var = self.var+1 endfunction
}
endfunction
; Instantiate a new object
t1 = CopyTable(myClass)
; Instantiale a new object
t2 = CopyTable(myClass)
; Uses the first object created and its method
t1.var = 10
t1:func1()
Code: Select all
; Defines the class
myClass={ var=0 }
function t1:func1func()
self.var = self.var + 1
endfunction
function myClass:New()
Return(CopyTable(self))
endfunction
Code: Select all
prototype_deck:New()
prototype_deck:Shuffle()
prototype_deck:DealACard()
prototype_deck:FindACard()
Code: Select all
SpecialCardsDeck = Prototype_deck:New()
Code: Select all
function prototype_deck:PutAboaToBottom()
stuff
endfunction
Code: Select all
player_deck[n]:PutAboaToBottom = Function () stuff EndFunction
Code: Select all
function PutAboaToBottom()
do the stuff
endfunction
for n=1 to 4
player_deck[n]:PutAboaToBottom = PutAboaToBottom
next