How to detect if anyone in party is a certain class?

Conditional Branch allows us to detect if a certain actor is a certain class. However this is unworkable when you have tons of actors. 


How can I detect if any actor in my party is of a certain class? For example, this can be used like so: if the party contains a Thief class, then you can unlock doors.


Two usages:


1. Detect if anyone in my current party is currently a Thief (in case class selection is on).


2. Detect if anyone who has joined me but may not be in my party is a Thief.
@watermark


Use this as a scripted conditional branch to check if any actors in your party is class 2.


$gameParty.members().some( function(mem) { return mem.currentClass().id === 2 }, this )


For #2 that largely depends on how you would keep track of people that "have joined you" but  "may not be in your party"
Thanks! Will go try it out.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-detect-if-anyone-in-party-is-a-certain-class.60997/