/**
  * validates the new move first (does the user own the country, has he/she enough res left)
  *
  * @param int $id_zarea
  * @param array $units
  * @return ModelProductionMove
  * @throws ControllerException
  * @throws \AttOn\Exceptions\ModelException
  * @throws \AttOn\Exceptions\NullPointerException
  */
 public function createProductionMove($id_zarea, $units)
 {
     $id_zarea = (int) $id_zarea;
     // check if already fixated
     if ($this->checkIfDone()) {
         throw new ControllerException('ProductionMove already finished.');
     }
     // check if processing
     $game = ModelGame::getGame($this->id_game);
     if ($game->checkProcessing()) {
         throw new ControllerException('Unable to create moves at this moment as the game-logic is currently processing.');
     }
     // check if valid area picked
     if ($id_zarea === 0) {
         throw new ControllerException('Choose a start and destination country.');
     }
     ModelGameArea::getGameArea($this->id_game, $id_zarea);
     // check for units
     $unit_count = 0;
     foreach ($units as $count) {
         if ($count < 0) {
             throw new ControllerException('No negative unit numbers allowed.');
         }
         $unit_count += $count;
     }
     if ($unit_count === 0) {
         throw new ControllerException('Choose at least one unit.');
     }
     $round = (int) $game->getRound();
     $phase = (int) $game->getIdPhase();
     if ($phase > PHASE_PRODUCTION) {
         ++$round;
     }
     $this->validateNewProductionMove($round, $id_zarea, $units);
     return ModelProductionMove::createProductionMove($this->id_user, $this->id_game, $round, $id_zarea, $units);
 }