public AvalonHelperModel SelectRole(int roleId) { if (game.GetUserStatus(Request.User).RoleId == 0) { game.SelectRole(Request.User, roleId); } Request.ViewTemplateName = "Player"; return(Player()); }
public bool SelectRole(IUser user, int roleId) { if (!addedPlayers) { baseGame.SelectRole(colin, roleId == 1 ? 3 : 1); // Colin will pick Merlin if the human player doesn't and servant 1 if he does baseGame.SelectRole(tom, roleId == 2 ? 7 : 2); // Tom will pick Percival if the human player doesn't and servant 2 if he does baseGame.SelectRole(rupert, roleId == 5 ? 7 : 5); // Rupert will pick servant 3 if the human player doesn't and a servant 5 if he does baseGame.SelectRole(angel, roleId == 6 ? 4 : 6); // Angel will pick servant 4 if the human player doesn't and a servant 2 if he does baseGame.SelectRole(katie, roleId == 9 ? 12 : 9); // Katie will pick Morgana if the human player doesn't and minion 1 if he does baseGame.SelectRole(alexander, roleId == 8 ? 13 : 8); // Alexander will pick Mordred if the human player doesn't and minion 2 if he does baseGame.SelectRole(cal, roleId == 10 ? 14 : 10); // Cal will pick the Assassin if the human player doesn't and minion 3 if he does addedPlayers = true; } return(baseGame.SelectRole(user, roleId)); }