// The BindRoles method however, should use object so anything can be sent here // from the constructors, then casted to the RoleInterface. private void BindRoles(object source, object destination, decimal amount) { // Make the RolePlayers act the Roles they are supposed to. SourceAccount = (SourceAccountRole)source; DestinationAccount = (DestinationAccountRole)destination; Amount = amount; }
private void BindRoles(object source, object creditors) { SourceAccount = (SourceAccountRole)source; Creditors = (CreditorsRole)creditors; }
public PayBills(SourceAccountRole source, CreditorsRole creditors) { BindRoles(source, creditors); }
public MoneyTransfer(SourceAccountRole source, DestinationAccountRole destination, decimal amount) { BindRoles(source, destination, amount); }