示例#1
0
 /**
  * shuffleDeck - interaction to shuffle deck
  *
  * @param OutputInterface $output
  * @param Table $table
  * @return
  */
 protected function shuffleDeck(OutputInterface $output, Table $table)
 {
     if ($this->getHelper('dialog')->askConfirmation($output, "<question>Would you like to shuffle the current deck?</question> [<comment>y or n</comment>] ", false)) {
         //shuffle the deck
         $table->getGame()->getDeck()->shuffle();
         //output
         $output->writeln("\nDeck has been shuffled.\n");
         //ask if the deck should be shown
         $this->showDeck($output, $table);
         return;
     }
     //output
     $output->writeln("\n");
 }