Removed dependency on Action. Made legalMoves a State member to avoid concurrency errors.