*
* @return The users in the channel or null if unavailable
*/
public ClanUser[] getUsers() {
if (inChannel()) {
RSComponent c = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, INTERFACE_CLAN_CHAT_USERS_LIST);
if (c != null) {
List<ClanUser> mates = new ArrayList<ClanUser>();
for (RSComponent user : c.getComponents()) {
if (user == null || user.getComponentName().isEmpty()) {
continue;
}
String name = user.getComponentName();
int userIndex = user.getComponentIndex();
RSComponent rank = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, 10);
rank = rank.getComponent(userIndex);
RSComponent world = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, 11);
world = world.getComponent(userIndex);
mates.add(new ClanUser(name, rank, world));
}
return mates.toArray(new ClanUser[mates.size()]);
}
}