示例#1
0
 private void fight(RobotDifficulty difficulty)
 {
     try
     {
         var battleResult = BattleService.PerformBattle(_userId, difficulty);
         var str          = formatBattleResult(battleResult);
         resultLabel.Text = str;
         BattleService.RecordBattle(_userId, str);
         updateStatistics(battleResult.Hero);
     }
     catch (Exception exception)
     {
         resultLabel.Text = formatErrorMessage(exception.Message);
     }
 }