public override void write(String message, Paper sheet) { int len = message.Length; if ( graphiteAmount < len ) { sheet.writeOn(message.Substring(0, graphiteAmount)); graphiteAmount = 0; } else { sheet.writeOn(message); graphiteAmount -= len; } }
public override void write(String message, Paper sheet) { int len = message.Length; if ( inkQuantity < len ) { sheet.writeOn(message.Substring(0, inkQuantity)); inkQuantity = 0; } else { sheet.writeOn(message); inkQuantity -= len; } }
public override void write(String message, Paper sheet) { if (!isOpen) { throw new ClosedPenException(); } int len = message.Length; if ( inkQuantity < len ) { sheet.writeOn(message.Substring(0, inkQuantity)); inkQuantity = 0; } else { sheet.writeOn(message); inkQuantity -= len; } }