コード例 #1
0
ファイル: MoveHelper.php プロジェクト: cleentfaar/windmill
 /**
  * @param MoveInterface $move
  * @param GameInterface $game
  *
  * @throws InvalidMoveException
  */
 public static function enrich(MoveInterface $move, GameInterface $game)
 {
     if ($move->getPiece() === null) {
         $move->setPiece($game->getBoard()->getSquare($move->getFrom())->getPiece());
     }
     self::validate($move, $game);
     if (!$move->getType()) {
         $move->setType(self::determineType($move, $game));
     }
 }