The Halfmove Clock inside an chess position object takes care of enforcing the fifty-move rule. This counter is reset after captures or pawn moves, and incremented otherwise. Also moves which lose the castling rights, that is rook- and king moves from their initial squares, including castling itself, increment the Halfmove Clock. However, those moves are irreversible in the sense to reverse the same rights - since once a castling right is lost, it is lost forever, as considered in detecting repetitions.
- Half Move Clock Confusion by HumbleProgrammer, OpenChess Forum, January 10, 2013 » Fifty-move Rule, Repetitions
- Fifty move counter and Null move by Tamás Kuzmics, CCC, August 09, 2017 » Fifty-move Rule, Null Move Pruning
- plycount - Wiktionary
- Counter from Wikipedia
- Clock (disambiguation) from Wikipedia
- Clock from Wikipedia
- Game clock from Wikipedia