|
Mi verrebbe da dire che un Difensore non e' un Giocatore (anche se colloquialmente lo e'), ma un Ruolo di un Giocatore.
Quindi secondo me Giocatore non dovrebbe avere metodi virtuali, ma contenere un oggetto di Tipo ruolo (che sara' poi specializzato in Difensore, Centrocampista etc) a cui delega il calcolo del valore.
__________________
One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions. —Guy Steele
|