My understanding on the "rules" for the castle move are:
1 Neither piece can have moved previously.
2. Any spaces between the King and Rook cannot be covered by the opponent.
3.No piece can be covered by the oppenent. (You cannot castle out of a "Check")
Problem: Chess Titan repeatedly castles if the rook is covered by the opponent.