4 ms·
Composition making more sense is exactly why you'd use an interface, as the function inside the class depends on the internal implementation of how you'd store
by RyanZAG 13y ago
Composition making more sense is exactly why you'd use an interface, as the function inside the class depends on the internal implementation of how you'd store the players most efficiently while still giving a common method to access them. If you used a trait it would lock in the list implementation across all types that HadPlayers etc.