A class diagram shows which Player members callers can use and which belong to its implementation. Read the design before writing the equivalent C#.
| Symbol | Meaning |
|---|---|
+ |
Public: callable or accessible by other code that can use the class |
- |
Private: accessible within the declaring class |
The space after each sign is part of our formatting convention. Visibility belongs to each member; a public class can contain private fields and private methods.
In this notation example, Player stores a turn count and lets callers record a turn. Its helper increases the count. This small model does not yet enforce a three-turn limit.
Player class.- numberOfTurns : int in the attributes compartment.+ RecordTurn() : void and - IncreaseTurnCount() : void in the operations compartment.