Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IConsole  regularConsole = new FunConsole();
            ProgramUI ui             = new ProgramUI(regularConsole);

            ui.Run();
            Console.Read();
        }
Exemplo n.º 2
0
        // e.g. git remote -v => args is [ "remote", "-v: ]
        // args are options you can run your program with
        // >> Game.exe useSave 1234
        static void Main(string[] args)
        {
            // if (args.Contains("useSave")) {.....}
            IConsole  regularConsole = new RegularConsole();
            var       funConsole     = new FunConsole("Rumperstill Skins");
            ProgramUI ui             = new ProgramUI(funConsole);

            ui.Run();

            // With DI, I can use interchangeable parts in my code
            // e.g. different UIs, like mobile vs web
            // or different databases (IDatabase??)
            // Shouldn't have to change any of the other code, just the part that's different.
        }