Rename firstRankDrops to firstRankPawnDrops
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 10 Jan 2020 19:15:25 +0000 (20:15 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 10 Jan 2020 19:15:25 +0000 (20:15 +0100)
No functional change.

src/parser.cpp
src/position.h
src/ucioption.cpp
src/variant.cpp
src/variant.h
src/variants.ini

index 55b9afb..8ed6074 100644 (file)
@@ -179,7 +179,7 @@ Variant* VariantParser::parse(Variant* v) {
     parse_attribute("pieceDrops", v->pieceDrops);
     parse_attribute("dropLoop", v->dropLoop);
     parse_attribute("capturesToHand", v->capturesToHand);
-    parse_attribute("firstRankDrops", v->firstRankDrops);
+    parse_attribute("firstRankPawnDrops", v->firstRankPawnDrops);
     parse_attribute("dropOnTop", v->dropOnTop);
     parse_attribute("whiteDropRegion", v->whiteDropRegion);
     parse_attribute("blackDropRegion", v->blackDropRegion);
index 548b609..67c2586 100644 (file)
@@ -128,7 +128,7 @@ public:
   bool piece_drops() const;
   bool drop_loop() const;
   bool captures_to_hand() const;
-  bool first_rank_drops() const;
+  bool first_rank_pawn_drops() const;
   bool drop_on_top() const;
   Bitboard drop_region(Color c) const;
   Bitboard drop_region(Color c, PieceType pt) const;
@@ -484,9 +484,9 @@ inline bool Position::captures_to_hand() const {
   return var->capturesToHand;
 }
 
-inline bool Position::first_rank_drops() const {
+inline bool Position::first_rank_pawn_drops() const {
   assert(var != nullptr);
-  return var->firstRankDrops;
+  return var->firstRankPawnDrops;
 }
 
 inline bool Position::drop_on_top() const {
@@ -509,7 +509,7 @@ inline Bitboard Position::drop_region(Color c, PieceType pt) const {
   if (pt == PAWN)
   {
       b &= ~promotion_zone_bb(c, promotion_rank(), max_rank());
-      if (!first_rank_drops())
+      if (!first_rank_pawn_drops())
           b &= ~rank_bb(relative_rank(c, RANK_1, max_rank()));
   }
   // Doubled shogi pawns
index 53d684d..c01c30f 100644 (file)
@@ -81,7 +81,7 @@ void on_variant_change(const Option &o) {
                                                               : "";
             if (v->pieceDrops)
             {
-                if (pt == PAWN && !v->firstRankDrops)
+                if (pt == PAWN && !v->firstRankPawnDrops)
                     suffix += "j";
                 else if (pt == SHOGI_PAWN && !v->shogiDoubledPawn)
                     suffix += "f";
index 5858169..960ee4e 100644 (file)
@@ -270,7 +270,7 @@ namespace {
     }
     Variant* chessgi_variant() {
         Variant* v = loop_variant();
-        v->firstRankDrops = true;
+        v->firstRankPawnDrops = true;
         return v;
     }
     Variant* bughouse_variant() {
index 9461ea2..5e599d9 100644 (file)
@@ -72,7 +72,7 @@ struct Variant {
   bool pieceDrops = false;
   bool dropLoop = false;
   bool capturesToHand = false;
-  bool firstRankDrops = false;
+  bool firstRankPawnDrops = false;
   bool dropOnTop = false;
   Bitboard whiteDropRegion = AllSquares;
   Bitboard blackDropRegion = AllSquares;
index 0f4bf3b..c2cd752 100644 (file)
 # pieceDrops: enable piece drops [bool] (default: false)
 # dropLoop: captures promoted pieces are not demoted [bool] (default: false)
 # capturesToHand: captured pieces are go to opponent's hand [bool] (default: false)
-# firstRankDrops: allow pawn drops to first rank [bool] (default: false)
+# firstRankPawnDrops: allow pawn drops to first rank [bool] (default: false)
 # dropOnTop: piece drops need to be on top of pieces on board (e.g., for connect4) [bool] (default: false)
 # whiteDropRegion: restrict region for piece drops of all white pieces [Bitboard]
 # blackDropRegion: restrict region for piece drops of all black pieces [Bitboard]