#include "computer.h"
#include "computer2.h"
#include "computer3.h"
#include "human.h"
#include "player-choice.h"
#include <iostream>
using namespace std;

std::unique_ptr<Player>  playerChoice(const std::string& msg, Color color)
{
   cout << "Definiere Spieler " << msg << '\n';
   cout << "* c == Computer\n";
   cout << "* 2 == Computer 2\n";
   cout << "* z == Computer Zufall\n";
   cout << "* m == Mensch\n";

   for (;;)
   {
      string in;
      getline(cin, in);
      if (in.length() == 1 && in[0] == 'c')
      {
         return make_unique<Computer>(color);
      }
      if (in.length() == 1 && in[0] == '2')
      {
         return make_unique<Computer2>(color);
      }
      if (in.length() == 1 && in[0] == 'z')
      {
         return make_unique<Computer3>(color);
      }
      if (in.length() == 1 && in[0] == 'm')
      {
         return make_unique<Human>(color);
      }
   }
}
