An interface names a behavior contract that different soccer-related classes can implement. It is not an instance containing the current player's state.
These complete declarations define a contract requiring RecordTurn and a Player implementation that increments its count.
public interface ITrainable
{
void RecordTurn();
}
public class Player : ITrainable
{
public int NumberOfTurns;
public void RecordTurn()
{
NumberOfTurns = NumberOfTurns + 1;
}
}Define ITrainable as a behavior contract
Require a public RecordTurn operation returning no value
Define Player as one implementation
Store a turn count in Player, not in this interface
Implement the operation by increasing that countThese words describe the class contract, not a sequence of runtime actions. Identify the types, stored members, operation inputs and results, and relationships before choosing compartments and connectors.
ITrainable marked <<interface>> and a class box Player.+RecordTurn() : void. Leave its attributes empty for this source.+NumberOfTurns : int and operation +RecordTurn() : void.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
An ITrainable reference can refer to a Player implementation and call the contracted operation. It does not mean new ITrainable() is valid.