public void Write(string content, IWritingUtensil utensil) { if (LastContent.Text != string.Empty) { PaperContent.Add(LastContent); } LastContent = new PaperContent(content, (utensil is IErasable)); }
public void Write(IWritingUtensil pencil, string message) { var characters = message.ToCharArray(); foreach (var character in characters) { _characters.Append(pencil.WriteCharacterIfCapable(character)); } }
public RunApplication(IStationary stationary, IWritingUtensil writingUtensil, Stack <IWritingUtensil> pencilDrawer, IEraseHelper eraseHelper, IEditHelper editHelper, IWriteAndSharpenHelper writeAndSharpenHelper) { _stationary = stationary; _writingUtensil = writingUtensil; _pencilDrawer = pencilDrawer; _eraseHelper = eraseHelper; _editHelper = editHelper; _writeAndSharpenHelper = writeAndSharpenHelper; }
// write test for this public void BuildNewPencil() { if (_pencilDrawer.Count != 0) { _writingUtensil = _pencilDrawer.Pop(); Console.WriteLine($"\nYou now have a new pencil. You have {_pencilDrawer.Count} pencil(s) left."); Console.ReadKey(); } else { Console.WriteLine("\nYou've run out of extra pencils!"); Console.ReadKey(); } }
public void Write(IWritingUtensil utensil) { Text = utensil.Write(); }
public EditHelper(IStationary stationary, IWritingUtensil writingUtensil) { _stationary = stationary; _writingUtensil = writingUtensil; }
public WriteAndSharpenHelper(IStationary stationary, IWritingUtensil writingUtensil) { _stationary = stationary; _writingUtensil = writingUtensil; }