public void Purchase(PurchasedDevice device, int monthLimit) { if (NotUsed(device)) { return; } UsedDevice currentlyUsedDevice = GetUsedDeviceBy(device); if (currentlyUsedDevice.UsedTooShort(monthLimit)) { return; } StopUsing(currentlyUsedDevice); Purchase(device); }
private void StopUsing(UsedDevice device) { _currentlyUsed.Remove(device); }
public bool IsSameDeviceAs(UsedDevice usedDevice) => Id.Equals(usedDevice.Id);