For this is a way to avoid having any need to change the original functions code.
For so far i have thought if i have a:
Code: Select all
function IDontWantToChange()
debugprint("This is the function I dont want to change")
endfunctionCode: Select all
Observer:Inform("Message to tell to observers")Code: Select all
gamestate = #NEXT_PLAYER_TURNCode: Select all
Function MyMessageSendingFunction()
IDontWantToChange()
Observer:Inform("MyMessageSendingFunction sending message here")
EndFunctionCode: Select all
function FirstCase()
IDontWantToChange()
gamestate = #FIRST_PLAYER_TURN
endfunction
Function SecondCase()
IDontWantToChange
gamestate = #SECOND_PLAYER_TURN
endfunction