andreaalf97 / ing-sw-2019-Alfieri-Carrioli-Ceruti

Adrenalina: the digital remake of a board game
2 stars 0 forks source link

Avoiding use of instanceof #6

Closed andreaalf97 closed 5 years ago

andreaalf97 commented 5 years ago

Good evening, as discussed with @ingconti , I'm opening this issue to discuss how to avoid using instanceof in our implementation. The problem is related to the SpawnSpot and AmmoSpot classes which extend the Spot class: they have individual methods like "pickWeapon" or "generateAmmos" which only apply to one of them. How can we fix this issue? Should we change our UML?

Thank you, Andrea

ingconti commented 5 years ago

see here. https://github.com/ingconti/DontKillKitties

ingconti commented 5 years ago

On 9 Apr 2019, at 18:06, Andrea Alfieri notifications@github.com wrote:

Good evening, as discussed with @ingconti https://github.com/ingconti , I'm opening this issue to discuss how to avoid using instanceof in our implementation. The problem is related to the SpawnSpot and AmmoSpot classes which extend the Spot class: they have individual methods like "pickWeapon" or "generateAmmos" which only apply to one of them. How can we fix this issue? Should we change our UML?

Thank you, Andrea

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andreaalf97/ing-sw-2019-Alfieri-Carrioli-Ceruti/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3GJ2TIWIlKLXj-qLH7XQvIKXIfcIV2ks5vfLp9gaJpZM4ck39H.

Answer is far far easy …

Simply said:

https://github.com/ingconti/DontKillKitties https://github.com/ingconti/DontKillKitties

Give a try


Ing. Gian Enrico Conti Ordine Ingegneri di Monza al n. A894

10047232@polimi.it