For building this game, we will adopt the following straightforward UML diagram:
So far, we have three main components:
- Itontine: Interface for Tontine game functions
- Cplayer: A class for managing players (enrollment, modification, and so on)
- Ctontine: A contract for implementing Tontine game functions
As you'll notice, the interface name starts with an I prefix, whereas contracts starts with a C prefix.
Now, let's talk code.