Example #1
0
        public bool ChangeName(string newName)
        {
            IslandRepository islandRepository = Context.islandRepository;

            if (islandRepository.GetAllIslands(Game).Select(b => b.Name).Contains(newName))
            {
                return(true);
            }
            Name = newName;
            return(false);
        }
Example #2
0
        public ActionResult GiveUpConfirmed(int id)
        {
            ApplicationUser user    = userRepository.GetUser(User.Identity.GetUserId());
            Game            game    = gameRepository.GetGame(id);
            List <Island>   islands = islandRepository.GetAllIslands(game, user);

            foreach (Island island in islands)
            {
                island.LeaveIsland();
            }
            userGamePropertyRepository.Deactive(game, user);

            return(RedirectToAction("GameList"));
        }