]> git.sesse.net Git - remoteglot/blobdiff - Position.pm
Inform the engine if we have a Chess960 game.
[remoteglot] / Position.pm
index 6976c96b68958880b0c58932a58cae0bedd92a14..8a42a6fa39f59f9e42bd80ec08bb5d7719a759e7 100644 (file)
@@ -221,6 +221,9 @@ sub make_move {
        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 {
@@ -242,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);