Ejemplo n.º 1
0
        public ActionResult <string> StartGame()
        {
            string result = "Game Started";

            try
            {
                _game.Start();
            }
            catch (NoPlayersException)
            {
                result = "This game has no players.";
            }
            return(result);
        }
Ejemplo n.º 2
0
        public ActionResult <Status> StartGame()
        {
            Status result = null;

            try
            {
                _game.Start();
                result = new Status(true, "Game Started");
            }
            catch (Exception)
            {
                result = new Status(false, "This game has no players.");
            }
            return(UpdateStatus(result));
        }