public gameEngineReturnMessage StartGame(string accessToken) { boolResponse returnMsg = new boolResponse(); var g = FindAdministratorsGame(accessToken); returnMsg.okay = (g != null); if (g != null) { g.Start(); } return(returnMsg); }
public gameEngineReturnMessage ReRoll(string accessToken, string facesToReRoll) { boolResponse returnMsg = new boolResponse(); game associatedGame = FindGameByPlayer(accessToken); if (associatedGame == null) { returnMsg.okay = false; return(returnMsg); } returnMsg.okay = associatedGame.ReRoll(accessToken, facesToReRoll); return(returnMsg); }
public gameEngineReturnMessage SetPlayersRunningOrder(string accessToken, List <string> playersNames) { boolResponse returnMsg = new boolResponse(); returnMsg.okay = false; var g = FindAdministratorsGame(accessToken); if (g == null) { return(returnMsg); } returnMsg.okay = g.SetRunningOrder(playersNames); return(returnMsg); }
public gameEngineReturnMessage AcceptHand(string accessToken) { boolResponse returnMsg = new boolResponse(); game associatedGame = FindGameByPlayer(accessToken); if (associatedGame == null) { returnMsg.okay = false; return(returnMsg); } bool acceptedOk = associatedGame.AcceptHand(accessToken); returnMsg.okay = acceptedOk; return(returnMsg); }
public gameEngineReturnMessage CloseForNewJoiners(string accessToken) { boolResponse returnMsg = new boolResponse(); returnMsg.okay = false; var g = FindGameByPlayer(accessToken); if (g == null) { return(returnMsg); } if (!g.hasAdministrator(accessToken)) { return(returnMsg); } g.CloseToNewJoiners(); returnMsg.okay = true; return(returnMsg); }
public gameEngineReturnMessage DeclareHand(string accessToken, pokerDiceHand hand) { game associatedGame = FindGameByPlayer(accessToken); boolResponse returnMsg = new boolResponse(); if (associatedGame == null) { returnMsg.okay = false; return(returnMsg); } bool declareAccepted = associatedGame.DeclareHand(accessToken, hand); if (declareAccepted) { returnMsg.okay = true; } else { returnMsg.okay = false; } return(returnMsg); }