Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //In folder IO
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- using WarCroft.Core.IO.Contracts;
- namespace WarCroft.Core.IO
- {
- public class StringBuilderWriter : IWriter
- {
- public StringBuilder sb = new StringBuilder();
- public void WriteLine(string message)
- {
- sb.AppendLine(message);
- }
- }
- }
- // in StartUp
- using System;
- using WarCroft.Core;
- using WarCroft.Core.IO;
- using WarCroft.Core.IO.Contracts;
- namespace WarCroft
- {
- public class StartUp
- {
- public static void Main(string[] args)
- {
- // IReader reader = new ConsoleReader();
- // IWriter writer = new ConsoleWriter();
- // var engine = new Engine(reader, writer);
- // engine.Run();
- /* Use the below configuration instead of the usual one if you wish to print all output messages together after the inputs for easier comparison with the example output. */
- IReader reader = new ConsoleReader();
- var sbWriter = new StringBuilderWriter();
- var engine = new Engine(reader, sbWriter);
- engine.Run();
- Console.WriteLine(sbWriter.sb.ToString().Trim());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement