Skip to main content

New answers tagged

7 votes
Accepted

Decouple game entity from its owner when logic depends on it

The crux of the issue appears to be that you are tying the identity of an object to the implementation. In it's simplest form a players ID could just be an integer (player 0,1,2,3...). Hence instead ...
DavidT's user avatar
  • 251
2 votes

Decouple game entity from its owner when logic depends on it

This is a job for Interfaces An interface is basically a class which has no implementation. It is a contract which a class can implement. (The link is for C# - but this pattern exists in most object-...
Tim C's user avatar
  • 499

Top 50 recent answers are included