public GoResponse(GoResultCode resultCode) { ResultCode = resultCode; }
public GoNameResponse(GoResultCode resultCode, string name) : base(resultCode) { Name = name; }
public GoAreaResponse(GoResultCode code) : base(code) { }
public GoHintResponse(GoResultCode resultCode, GoMove move) : base(resultCode) { Move = move; }
public GoScoreResponse(GoResultCode resultCode, GoColor winner, float score) : base(resultCode) { Winner = winner; Score = score; }
protected static async Task DisplayErrorCode(GoResultCode code) { var msg = EngineHelpers.GetResultCodeFriendlyMessage(code); await DisplayMessage("Whoops", msg); }
public GoEngineException(GoResultCode code, string msg) : base(msg) { Code = code; }
public GoGameStateResponse(GoResultCode resultCode, GoGameState gameState) : base(resultCode) { GameState = gameState; }
public static string GetResultCodeFriendlyMessage(GoResultCode code) { string msg; switch (code) { case GoResultCode.CommunicationError: msg = "Communication error. Are you connected to the Internet?"; break; case GoResultCode.EngineBusy: msg = "Server is playing too many simultaneous games. Please wait a minute and try again."; break; case GoResultCode.OtherEngineError: case GoResultCode.InternalError: msg = "Something blew up! Please try again."; break; case GoResultCode.GameAlreadyExists: msg = "Game already exists. Please try again."; break; case GoResultCode.GameDoesNotExist: msg = "Your game was aborted due to inactivity. Please start another one."; break; case GoResultCode.ClientOutOfSync: msg = "Your game was out of sync."; break; case GoResultCode.SimultaneousRequests: msg = "Are you playing this game on another device right now? If so, please leave and re-enter the game."; break; case GoResultCode.Success: msg = String.Empty; break; case GoResultCode.IllegalMoveSpaceOccupied: msg = "That space is occupied."; break; case GoResultCode.IllegalMoveSuicide: msg = "That move is suicide, which is not allowed."; break; case GoResultCode.IllegalMoveSuperKo: msg = "That move would replicate a previous board position, which violates the \"superko\" rule."; break; case GoResultCode.OtherIllegalMove: msg = "That move is not legal."; break; case GoResultCode.CannotScore: msg = "There are one or more stones that may be dead (or not). Please continue playing until this situation is resolved."; break; case GoResultCode.CannotSaveSgf: msg = "Cannot save SGF."; break; default: throw new Exception("Unsupported value for GoResultCode: " + code); } return(msg); }
public GoMoveResponse(GoResultCode resultCode, GoMove move, GoMoveResult result) : base(resultCode) { Move = move; MoveResult = result; }