示例#1
0
 public GoResponse(GoResultCode resultCode)
 {
     ResultCode = resultCode;
 }
示例#2
0
 public GoNameResponse(GoResultCode resultCode, string name)
     : base(resultCode)
 {
     Name = name;
 }
示例#3
0
 public GoAreaResponse(GoResultCode code) : base(code)
 {
 }
示例#4
0
 public GoHintResponse(GoResultCode resultCode, GoMove move)
     : base(resultCode)
 {
     Move = move;
 }
示例#5
0
 public GoScoreResponse(GoResultCode resultCode, GoColor winner, float score)
     : base(resultCode)
 {
     Winner = winner;
     Score  = score;
 }
示例#6
0
        protected static async Task DisplayErrorCode(GoResultCode code)
        {
            var msg = EngineHelpers.GetResultCodeFriendlyMessage(code);

            await DisplayMessage("Whoops", msg);
        }
示例#7
0
 public GoEngineException(GoResultCode code, string msg)
     : base(msg)
 {
     Code = code;
 }
示例#8
0
 public GoGameStateResponse(GoResultCode resultCode, GoGameState gameState) : base(resultCode)
 {
     GameState = gameState;
 }
示例#9
0
        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);
        }
示例#10
0
 public GoMoveResponse(GoResultCode resultCode, GoMove move, GoMoveResult result)
     : base(resultCode)
 {
     Move       = move;
     MoveResult = result;
 }