예제 #1
0
        public Response LetsBattle(AuthDetails?user)
        {
            if (user is null)
            {
                return(Response.Status(Status.BadRequest));
            }
            var result = game.Play(user.Username);

            return(result is null?Response.Status(Status.BadRequest) : Response.Json(result));
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var consoleWrapper = new ConsoleWrapper();

            var outputHandler = new OutputHandler(consoleWrapper);
            var inputHandler  = new InputHandler(outputHandler, consoleWrapper);
            var gameRunner    = new GameRunner(outputHandler);

            var coordinator = new GameCoordinator(gameRunner, inputHandler);


            outputHandler.Welcome();
            coordinator.Play();
        }