Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/rooms/RoomCategory.java

74 lines
1.7 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.rooms;
import com.eu.habbo.habbohotel.navigation.ListMode;
import java.sql.ResultSet;
import java.sql.SQLException;
@SuppressWarnings("NullableProblems")
public class RoomCategory implements Comparable<RoomCategory> {
private int id;
private int minRank;
private String caption;
private String captionSave;
private boolean canTrade;
private int maxUserCount;
private boolean official;
private ListMode displayMode;
2018-11-17 14:28:00 +01:00
private int order;
2018-07-06 15:30:00 +02:00
2019-05-26 20:14:53 +02:00
public RoomCategory(ResultSet set) throws SQLException {
2018-07-06 15:30:00 +02:00
this.id = set.getInt("id");
this.minRank = set.getInt("min_rank");
this.caption = set.getString("caption");
this.captionSave = set.getString("caption_save");
this.canTrade = set.getBoolean("can_trade");
this.maxUserCount = set.getInt("max_user_count");
this.official = set.getString("public").equals("1");
this.displayMode = ListMode.fromType(set.getInt("list_type"));
2018-11-17 14:28:00 +01:00
this.order = set.getInt("order_num");
2018-07-06 15:30:00 +02:00
}
public int getId() {
return this.id;
}
public int getMinRank() {
return this.minRank;
}
2019-05-26 20:14:53 +02:00
public String getCaption() {
2018-07-06 15:30:00 +02:00
return this.caption;
}
2019-05-26 20:14:53 +02:00
public String getCaptionSave() {
2018-07-06 15:30:00 +02:00
return this.captionSave;
}
public boolean isCanTrade() {
return this.canTrade;
}
2019-05-26 20:14:53 +02:00
public int getMaxUserCount() {
2018-07-06 15:30:00 +02:00
return this.maxUserCount;
}
2019-05-26 20:14:53 +02:00
public boolean isPublic() {
2018-07-06 15:30:00 +02:00
return this.official;
}
2019-05-26 20:14:53 +02:00
public ListMode getDisplayMode() {
2018-07-06 15:30:00 +02:00
return this.displayMode;
}
2019-05-26 20:14:53 +02:00
public int getOrder() {
2018-11-17 14:28:00 +01:00
return this.order;
}
2018-07-06 15:30:00 +02:00
@Override
public int compareTo(RoomCategory o) {
return o.getId() - this.getId();
}
}