Skip to main content
added 131 characters in body
Source Link
Aviv Cohn
  • 21.6k
  • 35
  • 127
  • 186

Here's a UML diagram to clarify even more:

enter image description here

And now, what if you wanted to give DefenseTurret some gun shooting capabilities? Just give it a Weapon reference and have it delegate to it, like you did with Soldier. You can reuse the code you already wrote without copy-pasting it all the time.

And now, what if you wanted to give DefenseTurret some gun shooting capabilities? Just give it a Weapon reference and have it delegate to it, like you did with Soldier. You can reuse the code you already wrote without copy-pasting it all the time.

Here's a UML diagram to clarify even more:

enter image description here

And now, what if you wanted to give DefenseTurret some gun shooting capabilities? Just give it a Weapon reference and have it delegate to it, like you did with Soldier. You can reuse the code you already wrote without copy-pasting it all the time.

added 3585 characters in body
Source Link
Aviv Cohn
  • 21.6k
  • 35
  • 127
  • 186
Loading
Source Link
Aviv Cohn
  • 21.6k
  • 35
  • 127
  • 186
Loading