]> git.sesse.net Git - remoteglot/blobdiff - Position.pm
Update copyright year.
[remoteglot] / Position.pm
index 39b89acbb47a7278dffac3c60e58240b96a83b92..8a42a6fa39f59f9e42bd80ec08bb5d7719a759e7 100644 (file)
@@ -218,6 +218,12 @@ sub make_move {
        }
        $np->{'player_w'} = $pos->{'player_w'};
        $np->{'player_b'} = $pos->{'player_b'};
+       if (exists($pos->{'start_fen'})) {
+               $np->{'start_fen'} = $pos->{'start_fen'};
+       }
+       if (exists($pos->{'chess960'})) {
+               $np->{'chess960'} = $pos->{'chess960'};
+       }
        if (defined($pretty_move)) {
                $np->{'last_move'} = $pretty_move;
        } else {
@@ -239,6 +245,11 @@ sub make_pretty_move {
        return ($pos, $uci_move);
 }
 
+sub is_chess960 {
+       my ($pos) = shift;
+       return (defined($pos->{'chess960'}) && $pos->{'chess960'});
+}
+
 sub _pos_to_square {
         my ($row, $col) = @_;
         return sprintf("%c%d", ord('a') + $col, 8 - $row);