示例#1
0
        public static void Main()
        {
            IKernel kernel = new StandardKernel(new NinjaGaiden());

            var player1 = kernel.Get<AmericanNinja>();
            var stage1 = kernel.Get<TheKidnapLevel>();
            var game = new Engine(player1) { Points = 10000 };

            game.Run(stage1);

            Console.WriteLine(player1.Blood == 0 ? " GAME OVER " : " YOU WIN ");
            Console.WriteLine("Points: " + game.Points);
        }
        private static void Main(string[] args)
        {
            IInputHandler consoleInputHandler = new ConsoleInputHandler();
            IOutputRenderer consoleOutputRenderer = new ConsoleOutputRenderer();
            IGameData data = new GameData();
            ICommandManager cm = new CommandManager();
            IEngine engine = new Engine(
                consoleInputHandler,
                consoleOutputRenderer,
                data,
                cm);

            engine.Run();
        }
示例#3
0
        public static void Main()
        {
            IKernel kernel = new StandardKernel(new DungeonMaster());

            WelcomePlayer();

            ICharacter adventurer = SetupCharacter(kernel);

            if (adventurer == null) return;

            var adventure = kernel.Get<TheLostCavernsOfTsojcanth>();

            var game = new Engine(adventurer) { Points = 0 };

            game.Run(adventure);
        }