void HareAction::perfom(Table& table, Player** players, QueryResult queryResult) { int x0, x1, y0, y1; try { y1 = stoi(queryResult.getNext()); x1 = stoi(queryResult.getNext()); y0 = stoi(queryResult.getNext()); x0 = stoi(queryResult.getNext()); } catch (...) { throw string("InvalidCoordinatesException"); } if (table.get(y0, x0) == nullptr) { throw string("NoSuchCardException"); } if (table.get(y0, x0)->getAnimal(0, 0) == Animal::START) { throw string("StartCardCanNotBeMovedException"); } shared_ptr<AnimalCard> card = table.pickAt(y0, x0); try { table.addAt(card, y1, x1); } catch (string e) { table.addWithoutCheck(card, y0, x0); throw e; } }