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")
endfunction
Code: Select all
Observer:Inform("Message to tell to observers")
Code: Select all
gamestate = #NEXT_PLAYER_TURN
Code: Select all
Function MyMessageSendingFunction()
IDontWantToChange()
Observer:Inform("MyMessageSendingFunction sending message here")
EndFunction
Code: Select all
function FirstCase()
IDontWantToChange()
gamestate = #FIRST_PLAYER_TURN
endfunction
Function SecondCase()
IDontWantToChange
gamestate = #SECOND_PLAYER_TURN
endfunction