示例#1
0
        /// <summary>
        /// Tells the service if the user is leaving the table.
        /// </summary>
        private void leave()
        {
            BlackjackResponse response = new BlackjackEngineProxy().LeaveTable(
                new BlackjackTable(_table, _table, null, null),
                new BlackjackPlayer(_player));

            if (response.Result == BlackjackResult.Failure)
            {
                throw new Exception(response.Message);
            }
        }
示例#2
0
        /// <summary>
        /// Updates the form with the newest version of the
        /// info. This is so that if another user finishes
        /// their turn, the current client will get updated.
        /// </summary>
        private void runUpdate()
        {
            while (true == _running)
            {
                try
                {
                    if (true == _running)
                    {
                        BlackjackResponse response =
                            new BlackjackEngineProxy().Get(
                                new BlackjackTable(_table, _table, null, null),
                                new BlackjackPlayer(_player));

                        processResponse(response);
                    }

                    Thread.Sleep(1000);
                }
                catch (Exception exception)
                {
                    handleError(exception);
                }
            }
        }