ChessDotNet.ChessGame.IsStalemated C# (CSharp) Method

IsStalemated() public method

public IsStalemated ( Player player ) : bool
player Player
return bool
        public virtual bool IsStalemated(Player player)
        {
            Cache<bool> cache = player == Player.White ? stalematedCacheWhite : stalematedCacheBlack;
            if (cache.CachedAt == Moves.Count)
            {
                return cache.Value;
            }

            return cache.UpdateCache(WhoseTurn == player && !IsInCheck(player) && !HasAnyValidMoves(player), Moves.Count);
        }