From Anonimo, 3 Months ago, written in GAMBAS.
Embed
  1. Private ObservadorControl As Observer
  2.  
  3. Public Sub _new()
  4.  
  5.   ObservadorControl = New Observer(Me, True)
  6.  
  7.  
  8. Public Sub addSoldado(p As Peloton)
  9.      
  10.   ObservadorControl = New Observer(p) As "ObservadorControl"
  11.  
  12.  
  13. Public Sub dato(objeto As Object, d As Point)
  14.  
  15.   Print "Posicion atacada (desde clase): ", objeto, d.x, d.y
  16.  
  17.  
  18. Public Sub ObservadorControl_ataque(obj As Object, d As Point)
  19.  
  20.   Print "Posicion atacada (evento desde objeto): ", obj, d.x, d.y
  21.  
  22.