Closed romaneo closed 3 years ago
A few more useful links:
Guard clause: https://refactoring.guru/uk/replace-nested-conditional-with-guard-clauses https://medium.com/@scadge/if-statements-design-guard-clauses-might-be-all-you-need-67219a1a981a
An array of abstract class type: https://cs.stackexchange.com/questions/46984/creating-arrays-of-object-of-abstract-class-in-statically-typed-object-oriented
Further readings: https://metanit.com/sharp/tutorial/3.12.php
Please check the program output:
Now it works fine.
Note, here is another "cleaner" way to implement this fix:
This implementation actively uses this
pointer. As a result, you do not need to retrieve data of previous
(sender) player inside of the current
(this)
If no questions anymore, please merge this branch to the main and close the issue
Create a program that imitates a Relay race
Let's say our relay race consist of four different
activities
in the following order:Each activity must have its own
player
. The new activity can bestarted
only when thebaton
ispassed
Programm limitation:
doesn't know each other
(means that it is not legit to keep a reference to other player class inside of the current player )interactor
Learning materials: