roleAt method

Role? roleAt(
  1. Square square
)

Gets the Role at this Square, if any.

Implementation

Role? roleAt(Square square) {
  for (final role in Role.values) {
    if (byRole(role).has(square)) {
      return role;
    }
  }
  return null;
}