Arcturus-Community/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildListComposer.java

37 lines
1.5 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.messages.outgoing.guilds;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.guilds.Guild;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
import gnu.trove.set.hash.THashSet;
2019-05-26 20:14:53 +02:00
public class GuildListComposer extends MessageComposer {
2018-07-06 15:30:00 +02:00
private final THashSet<Guild> guilds;
private final Habbo habbo;
2019-05-26 20:14:53 +02:00
public GuildListComposer(THashSet<Guild> guilds, Habbo habbo) {
2018-07-06 15:30:00 +02:00
this.guilds = guilds;
this.habbo = habbo;
}
@Override
2019-05-26 20:14:53 +02:00
public ServerMessage compose() {
2018-07-06 15:30:00 +02:00
this.response.init(Outgoing.GuildListComposer);
this.response.appendInt(this.guilds.size());
2019-05-26 20:14:53 +02:00
for (Guild guild : this.guilds) {
2018-07-06 15:30:00 +02:00
this.response.appendInt(guild.getId());
this.response.appendString(guild.getName());
this.response.appendString(guild.getBadge());
this.response.appendString(Emulator.getGameEnvironment().getGuildManager().getSymbolColor(guild.getColorOne()).valueA);
this.response.appendString(Emulator.getGameEnvironment().getGuildManager().getBackgroundColor(guild.getColorTwo()).valueA);
this.response.appendBoolean(this.habbo.getHabboStats().guild == guild.getId());
this.response.appendInt(guild.getOwnerId());
this.response.appendBoolean(guild.hasForum());
}
return this.response;
}
}